From 5608589f03499bf4b76afaf9a7ab4a18c2a209bd Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 12 Apr 2010 18:21:59 +0000 Subject: [PATCH] * Remove leftover debug printf()s * Fix the layouting of BColorControl so it is now locale aware git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36191 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/LocaleBackend.cpp | 3 +-- src/kits/interface/ColorControl.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/kits/LocaleBackend.cpp b/src/kits/LocaleBackend.cpp index d255687eff..30e0430b9b 100644 --- a/src/kits/LocaleBackend.cpp +++ b/src/kits/LocaleBackend.cpp @@ -26,7 +26,7 @@ static void LoadBackend() { image_id libLocaleAddonID = load_add_on("/system/lib/liblocale.so"); -printf("backend-id: %ld\n", libLocaleAddonID); + if (libLocaleAddonID < 0) return; LocaleBackend* (*createInstanceFunc)(); @@ -34,7 +34,6 @@ printf("backend-id: %ld\n", libLocaleAddonID); B_SYMBOL_TYPE_TEXT, (void**)&createInstanceFunc) != B_OK) return; -printf("invoking creator func\n"); gLocaleBackend = createInstanceFunc(); } diff --git a/src/kits/interface/ColorControl.cpp b/src/kits/interface/ColorControl.cpp index d1b9478d53..73914194eb 100644 --- a/src/kits/interface/ColorControl.cpp +++ b/src/kits/interface/ColorControl.cpp @@ -13,6 +13,8 @@ #include +#include + #include #include @@ -79,11 +81,8 @@ BColorControl::_InitData(color_control_layout layout, float size, // we need to translate some strings, and in order to do so, we need // to use the LocaleBackend to reache liblocale.so if (gLocaleBackend == NULL) -{ -printf("trying to load backend\n"); LocaleBackend::LoadBackend(); -printf("backend = %p\n", gLocaleBackend); -} + fPaletteMode = BScreen(B_MAIN_SCREEN_ID).ColorSpace() == B_CMAP8; //TODO: we don't support workspace and colorspace changing for now // so we take the main_screen colorspace at startup @@ -115,7 +114,8 @@ printf("backend = %p\n", gLocaleBackend); SetValue(value); } else { BRect rect(0.0f, 0.0f, 70.0f, 15.0f); - float labelWidth = StringWidth("Green:") + 5; + float labelWidth = std::max(StringWidth(red), + std::max(StringWidth(green), StringWidth(blue))) + 5; rect.right = labelWidth + StringWidth("999") + 20; // red