[haiku-commits] haiku: hrev50421 - in src: kits/interface apps/deskbar

  • From: waddlesplash@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 16 Jul 2016 18:52:18 +0200 (CEST)

hrev50421 adds 3 changesets to branch 'master'
old head: 30dea2f64eb194d16cf49ff089186262c238fa24
new head: 7cdea13cf9d765ef86793ebab86f6167ee179abf
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=7cdea13cf9d7+%5E30dea2f64eb1

----------------------------------------------------------------------------

de9c53f8f500: BButton: Revert to using B_CONTROL_TEXT_COLOR for text.
  
  Fixes #12604.
  
  Signed-off-by: Augustin Cavalier <waddlesplash@xxxxxxxxx>
  The switch to using HighColor() was made in the "Set*UIColor" commit,
  but as some applications set it for some reason, it broke BeOS compatibility.

2e95f9e6df70: Deskbar: Expand already running applications on startup.
  
  Fixes #12480.
  
  Another way to solve this would be to ensure that TExpandoMenuBar was 
subscribed
  to TBarApp's notifications before TExpandoMenuBar::AttachedToWindow() returns,
  but creates other problems that this solution does not have.
  
  Signed-off-by: Augustin Cavalier <waddlesplash@xxxxxxxxx>

7cdea13cf9d7: BBox: Correct low color for drawing label.
  
  Includes some simplification for existing code.
  
  Fixes #12628, which was mostly exhibited in FilWip and a few other legacy
  applications which used the default low color and a custom background color.
  
  Signed-off-by: Augustin Cavalier <waddlesplash@xxxxxxxxx>

                                        [ looncraz <looncraz@xxxxxxxxxxxx> ]

----------------------------------------------------------------------------

4 files changed, 21 insertions(+), 7 deletions(-)
src/apps/deskbar/ExpandoMenuBar.cpp |  7 +++++++
src/apps/deskbar/ExpandoMenuBar.h   |  1 +
src/kits/interface/Box.cpp          | 18 ++++++++++++------
src/kits/interface/Button.cpp       |  2 +-

############################################################################

Commit:      de9c53f8f5008c7b3b0af75d944a628e17f6dffe
URL:         http://cgit.haiku-os.org/haiku/commit/?id=de9c53f8f500
Author:      looncraz <looncraz@xxxxxxxxxxxx>
Date:        Tue Jul 12 21:39:51 2016 UTC
Committer:   Augustin Cavalier <waddlesplash@xxxxxxxxx>
Commit-Date: Sat Jul 16 16:44:18 2016 UTC

Ticket:      https://dev.haiku-os.org/ticket/12604

BButton: Revert to using B_CONTROL_TEXT_COLOR for text.

Fixes #12604.

Signed-off-by: Augustin Cavalier <waddlesplash@xxxxxxxxx>
The switch to using HighColor() was made in the "Set*UIColor" commit,
but as some applications set it for some reason, it broke BeOS compatibility.

----------------------------------------------------------------------------

diff --git a/src/kits/interface/Button.cpp b/src/kits/interface/Button.cpp
index 6d3fd4b..9fc077c 100644
--- a/src/kits/interface/Button.cpp
+++ b/src/kits/interface/Button.cpp
@@ -135,7 +135,7 @@ BButton::Draw(BRect updateRect)
        BRect rect(Bounds());
        rgb_color background = ViewColor();
        rgb_color base = LowColor();
-       rgb_color textColor = HighColor();
+       rgb_color textColor = ui_color(B_CONTROL_TEXT_COLOR);
 
        uint32 flags = be_control_look->Flags(this);
        if (_Flag(FLAG_DEFAULT))

############################################################################

Commit:      2e95f9e6df7059cee13d193169a98c19374e48f7
URL:         http://cgit.haiku-os.org/haiku/commit/?id=2e95f9e6df70
Author:      looncraz <looncraz@xxxxxxxxxxxx>
Date:        Tue Jul 12 22:55:55 2016 UTC
Committer:   Augustin Cavalier <waddlesplash@xxxxxxxxx>
Commit-Date: Sat Jul 16 16:48:36 2016 UTC

Ticket:      https://dev.haiku-os.org/ticket/12480

Deskbar: Expand already running applications on startup.

Fixes #12480.

Another way to solve this would be to ensure that TExpandoMenuBar was subscribed
to TBarApp's notifications before TExpandoMenuBar::AttachedToWindow() returns,
but creates other problems that this solution does not have.

Signed-off-by: Augustin Cavalier <waddlesplash@xxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/src/apps/deskbar/ExpandoMenuBar.cpp 
b/src/apps/deskbar/ExpandoMenuBar.cpp
index b4c01b1..cebdaa6 100644
--- a/src/apps/deskbar/ExpandoMenuBar.cpp
+++ b/src/apps/deskbar/ExpandoMenuBar.cpp
@@ -92,6 +92,7 @@ TExpandoMenuBar::TExpandoMenuBar(TBarView* barView, bool 
vertical)
        fBarView(barView),
        fVertical(vertical),
        fOverflow(false),
+       fFirstBuild(true),
        fDeskbarMenuWidth(kMinMenuItemWidth),
        fPreviousDragTargetItem(NULL),
        fLastMousedOverItem(NULL),
@@ -506,6 +507,10 @@ TExpandoMenuBar::BuildItems()
                                AddItem(item, 0);
                        } else
                                AddItem(item);
+
+                       if (fFirstBuild && fVertical && 
settings->expandNewTeams)
+                               item->ToggleExpandState(true);
+
                } else {
                        // existing team, update info and add it
                        TTeamMenuItem* item = iter->second;
@@ -551,6 +556,8 @@ TExpandoMenuBar::BuildItems()
                // weird value - we just override it again
                ResizeTo(itemWidth, 0);
        }
+
+       fFirstBuild = false;
 }
 
 
diff --git a/src/apps/deskbar/ExpandoMenuBar.h 
b/src/apps/deskbar/ExpandoMenuBar.h
index 468e3c6..5f338c5 100644
--- a/src/apps/deskbar/ExpandoMenuBar.h
+++ b/src/apps/deskbar/ExpandoMenuBar.h
@@ -114,6 +114,7 @@ private:
                        TBarView*               fBarView;
                        bool                    fVertical : 1;
                        bool                    fOverflow : 1;
+                       bool                    fFirstBuild : 1;
 
                        float                   fDeskbarMenuWidth;
                        TTeamMenuItem*  fPreviousDragTargetItem;

############################################################################

Revision:    hrev50421
Commit:      7cdea13cf9d765ef86793ebab86f6167ee179abf
URL:         http://cgit.haiku-os.org/haiku/commit/?id=7cdea13cf9d7
Author:      looncraz <looncraz@xxxxxxxxxxxx>
Date:        Mon Jul 11 02:47:23 2016 UTC
Committer:   Augustin Cavalier <waddlesplash@xxxxxxxxx>
Commit-Date: Sat Jul 16 16:50:51 2016 UTC

Ticket:      https://dev.haiku-os.org/ticket/12628

BBox: Correct low color for drawing label.

Includes some simplification for existing code.

Fixes #12628, which was mostly exhibited in FilWip and a few other legacy
applications which used the default low color and a custom background color.

Signed-off-by: Augustin Cavalier <waddlesplash@xxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/src/kits/interface/Box.cpp b/src/kits/interface/Box.cpp
index 481cba0..7efdbb4 100644
--- a/src/kits/interface/Box.cpp
+++ b/src/kits/interface/Box.cpp
@@ -273,11 +273,17 @@ BBox::AttachedToWindow()
 {
        AdoptParentColors();
 
-       if (ViewColor() == B_TRANSPARENT_COLOR) {
-               SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
-               SetLowUIColor(B_PANEL_BACKGROUND_COLOR);
-               SetHighUIColor(B_PANEL_TEXT_COLOR);
-       }
+       // Force low color to match view color for proper label drawing.
+       float viewTint = B_NO_TINT;
+       float lowTint = B_NO_TINT;
+
+       if (LowUIColor(&lowTint) != ViewUIColor(&viewTint) || viewTint != 
lowTint)
+               SetLowUIColor(ViewUIColor(), viewTint);
+       else if (LowColor() != ViewColor())
+               SetLowColor(ViewColor());
+
+       if (ViewColor() == B_TRANSPARENT_COLOR)
+               AdoptSystemColors();
 
        // The box could have been resized in the mean time
        fBounds = Bounds();
@@ -659,7 +665,7 @@ BBox::_InitObject(BMessage* archive)
                        fLabelView = ChildAt(0);
        }
 
-       SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
+       AdoptSystemColors();
 }
 
 


Other related posts:

  • » [haiku-commits] haiku: hrev50421 - in src: kits/interface apps/deskbar - waddlesplash