Opened 8 years ago

Closed 7 years ago

#12981 closed bug (fixed)

BSpinner label not showing in some cases

Reported by: zephjc Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc: jessicah
Blocked By: Blocking:
Platform: x86

Description

In WebPositive, in the Settings window, the label for the spinner control is missing (at the bottom of the window, just above the Apply and Cancel buttons):

http://i.imgur.com/IEj7VNQ.png

This is what it is supposed to look like:

http://i.imgur.com/ZNQWqhp.png

I've been trying to debug with basic logging in BAbstractSpinner::_DrawLabel and even in BControlLook::DrawLabel, but the label value seems to be retained the whole way through.

The only "fix" I've found for the WebPositive problem is altering where fDaysInHistory is instantiated, moving it from before the fShowTabsIfOnlyOnePage setup to after it, in src/apps/webpositive/SettingsWindow.cpp ~L308

diff --git a/src/apps/webpositive/SettingsWindow.cpp b/src/apps/webpositive/SettingsWindow.cpp
index a6ab410..438b88c 100644
--- a/src/apps/webpositive/SettingsWindow.cpp
+++ b/src/apps/webpositive/SettingsWindow.cpp
@@ -305,6 +305,12 @@ SettingsWindow::_CreateGeneralPage(float spacing)
        fNewTabBehaviorMenu = new BMenuField("new tab behavior",
                B_TRANSLATE("New tabs:"), newTabBehaviorMenu);
 
+
+       fShowTabsIfOnlyOnePage = new BCheckBox("show tabs if only one page",
+               B_TRANSLATE("Show tabs if only one page is open"),
+               new BMessage(MSG_TAB_DISPLAY_BEHAVIOR_CHANGED));
+       fShowTabsIfOnlyOnePage->SetValue(B_CONTROL_ON);
+
        fDaysInHistory = new BSpinner("days in history",
                B_TRANSLATE("Number of days to keep links in History menu:"),
                new BMessage(MSG_HISTORY_MENU_DAYS_CHANGED));
@@ -312,11 +318,6 @@ SettingsWindow::_CreateGeneralPage(float spacing)
        fDaysInHistory->SetValue(
                BrowsingHistory::DefaultInstance()->MaxHistoryItemAge());
 
-       fShowTabsIfOnlyOnePage = new BCheckBox("show tabs if only one page",
-               B_TRANSLATE("Show tabs if only one page is open"),
-               new BMessage(MSG_TAB_DISPLAY_BEHAVIOR_CHANGED));
-       fShowTabsIfOnlyOnePage->SetValue(B_CONTROL_ON);
-
        fAutoHideInterfaceInFullscreenMode = new BCheckBox("auto-hide interface",
                B_TRANSLATE("Auto-hide interface in full screen mode"),
                new BMessage(MSG_AUTO_HIDE_INTERFACE_BEHAVIOR_CHANGED));

Likewise, the SerialConnect app has a similar problem with the Baud Rate window (Settings -> Baud Rate -> Custom) which looks like this:

http://i.imgur.com/zWiMkUV.png

But is supposed to look like this:

http://i.imgur.com/IpiUtL9.png

with the label showing.

This change fixes it, but all the change does is move the fSpinner instantiation outside the Add() call and onto its own line:

diff --git a/src/apps/serialconnect/CustomRateWindow.cpp b/src/apps/serialconnect/CustomRateWindow.cpp
index 53eb5e4..64eb92e 100644
--- a/src/apps/serialconnect/CustomRateWindow.cpp
+++ b/src/apps/serialconnect/CustomRateWindow.cpp
@@ -30,11 +30,13 @@ CustomRateWindow::CustomRateWindow(int baudrate)
        BGroupView* root = new BGroupView(B_VERTICAL);
        AddChild(root);
 
+       fSpinner = new BSpinner("spin", B_TRANSLATE("Baudrate:"), NULL);
+
        BGroupLayoutBuilder(root)
                .SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
                        B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING)
                .AddGroup(B_HORIZONTAL)
-                       .Add(fSpinner = new BSpinner("spin", B_TRANSLATE("Baudrate:"), NULL))
+                       .Add(fSpinner)
                .End()
                .AddGroup(B_HORIZONTAL)
                        .AddGlue()

Attachments (1)

0001-InterfaceKit-fixed-BSpinner-s-label-rendering.patch (1.3 KB ) - added by accessays 7 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by zephjc, 8 years ago

As a note, both UIs are using BGroupLayoutBuilder to generate the structure, so that might be related.

and damnit, the description of the ticket should be

"BSpinner label not showing in some cases"

Last edited 8 years ago by zephjc (previous) (diff)

comment:2 by jessicah, 8 years ago

Cc: jessicah added
Summary: BSpinner label now showing in some casesBSpinner label not showing in some cases

comment:3 by diver, 7 years ago

Component: User InterfaceKits/Interface Kit
Owner: changed from stippi to nobody

comment:4 by accessays, 7 years ago

patch: 01

comment:5 by accessays, 7 years ago

Added a possible fix: on a specific line a copy was created instead of a reference. P.S. that would lead to several values being uninitialized and rendering failed.

Last edited 7 years ago by accessays (previous) (diff)

comment:6 by pulkomandy, 7 years ago

Resolution: fixed
Status: newclosed

Applied in hrev51357. Thanks!

Note: See TracTickets for help on using tickets.