[haiku-commits] haiku: hrev45498 - src/apps/deskbar

  • From: jscipione@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 14 Apr 2013 20:08:12 +0200 (CEST)

hrev45498 adds 1 changeset to branch 'master'
old head: f2e15d076c9986adfec1c538d582391613781364
new head: 753d86ac8426919d5eefc9dc0e35b2cfbfe12735
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=753d86a+%5Ef2e15d0

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

753d86a: Need to SaveExpandedState() before rebuilding items.
  
  Also, if mini-mode we can skip updating the view because it doesn't get drawn
  until you click the TeamMenu expander.

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

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

Revision:    hrev45498
Commit:      753d86ac8426919d5eefc9dc0e35b2cfbfe12735
URL:         http://cgit.haiku-os.org/haiku/commit/?id=753d86a
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Sun Apr 14 18:05:29 2013 UTC

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

1 file changed, 51 insertions(+), 24 deletions(-)
src/apps/deskbar/BarApp.cpp | 75 ++++++++++++++++++++++++++++-------------

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

diff --git a/src/apps/deskbar/BarApp.cpp b/src/apps/deskbar/BarApp.cpp
index 75b60b6..971d00c 100644
--- a/src/apps/deskbar/BarApp.cpp
+++ b/src/apps/deskbar/BarApp.cpp
@@ -466,10 +466,12 @@ TBarApp::MessageReceived(BMessage* message)
 
                case kAlwaysTop:
                        fSettings.alwaysOnTop = !fSettings.alwaysOnTop;
-                       fBarWindow->SetFeel(fSettings.alwaysOnTop ?
-                               B_FLOATING_ALL_WINDOW_FEEL : 
B_NORMAL_WINDOW_FEEL);
+
                        if (fPreferencesWindow != NULL)
                                
fPreferencesWindow->PostMessage(kUpdatePreferences);
+
+                       fBarWindow->SetFeel(fSettings.alwaysOnTop ?
+                               B_FLOATING_ALL_WINDOW_FEEL : 
B_NORMAL_WINDOW_FEEL);
                        break;
 
                case kAutoRaise:
@@ -483,34 +485,44 @@ TBarApp::MessageReceived(BMessage* message)
                case kAutoHide:
                        fSettings.autoHide = !fSettings.autoHide;
 
+                       if (fPreferencesWindow != NULL)
+                               
fPreferencesWindow->PostMessage(kUpdatePreferences);
+
                        fBarWindow->Lock();
                        fBarView->HideDeskbar(fSettings.autoHide);
                        fBarWindow->Unlock();
-
-                       if (fPreferencesWindow != NULL)
-                               
fPreferencesWindow->PostMessage(kUpdatePreferences);
                        break;
 
                case kTrackerFirst:
                        fSettings.trackerAlwaysFirst = 
!fSettings.trackerAlwaysFirst;
 
+                       if (fPreferencesWindow != NULL)
+                               
fPreferencesWindow->PostMessage(kUpdatePreferences);
+
+                       // if mini mode we don't need to update the view
+                       if (fBarView->MiniState())
+                               break;
+
                        fBarWindow->Lock();
+                       fBarView->SaveExpandedItems();
                        fBarView->PlaceApplicationBar();
                        fBarWindow->Unlock();
-
-                       if (fPreferencesWindow != NULL)
-                               
fPreferencesWindow->PostMessage(kUpdatePreferences);
                        break;
 
                case kSortRunningApps:
                        fSettings.sortRunningApps = !fSettings.sortRunningApps;
 
+                       if (fPreferencesWindow != NULL)
+                               
fPreferencesWindow->PostMessage(kUpdatePreferences);
+
+                       // if mini mode we don't need to update the view
+                       if (fBarView->MiniState())
+                               break;
+
                        fBarWindow->Lock();
+                       fBarView->SaveExpandedItems();
                        fBarView->PlaceApplicationBar();
                        fBarWindow->Unlock();
-
-                       if (fPreferencesWindow != NULL)
-                               
fPreferencesWindow->PostMessage(kUpdatePreferences);
                        break;
 
                case kUnsubscribe:
@@ -524,34 +536,49 @@ TBarApp::MessageReceived(BMessage* message)
                case kSuperExpando:
                        fSettings.superExpando = !fSettings.superExpando;
 
+                       if (fPreferencesWindow != NULL)
+                               
fPreferencesWindow->PostMessage(kUpdatePreferences);
+
+                       // if mini mode we don't need to update the view
+                       if (fBarView->MiniState())
+                               break;
+
                        fBarWindow->Lock();
+                       fBarView->SaveExpandedItems();
                        fBarView->PlaceApplicationBar();
                        fBarWindow->Unlock();
-
-                       if (fPreferencesWindow != NULL)
-                               
fPreferencesWindow->PostMessage(kUpdatePreferences);
                        break;
 
                case kExpandNewTeams:
                        fSettings.expandNewTeams = !fSettings.expandNewTeams;
 
+                       if (fPreferencesWindow != NULL)
+                               
fPreferencesWindow->PostMessage(kUpdatePreferences);
+
+                       // if mini mode we don't need to update the view
+                       if (fBarView->MiniState())
+                               break;
+
                        fBarWindow->Lock();
+                       fBarView->SaveExpandedItems();
                        fBarView->PlaceApplicationBar();
                        fBarWindow->Unlock();
-
-                       if (fPreferencesWindow != NULL)
-                               
fPreferencesWindow->PostMessage(kUpdatePreferences);
                        break;
 
                case kHideLabels:
                        fSettings.hideLabels = !fSettings.hideLabels;
 
+                       if (fPreferencesWindow != NULL)
+                               
fPreferencesWindow->PostMessage(kUpdatePreferences);
+
+                       // if mini mode we don't need to update the view
+                       if (fBarView->MiniState())
+                               break;
+
                        fBarWindow->Lock();
+                       fBarView->SaveExpandedItems();
                        fBarView->PlaceApplicationBar();
                        fBarWindow->Unlock();
-
-                       if (fPreferencesWindow != NULL)
-                               
fPreferencesWindow->PostMessage(kUpdatePreferences);
                        break;
 
                case kResizeTeamIcons:
@@ -575,11 +602,15 @@ TBarApp::MessageReceived(BMessage* message)
 
                        ResizeTeamIcons();
 
+                       if (fPreferencesWindow != NULL)
+                               
fPreferencesWindow->PostMessage(kUpdatePreferences);
+
                        // if mini mode we don't need to update the view
                        if (fBarView->MiniState())
                                break;
 
                        fBarWindow->Lock();
+                       fBarView->SaveExpandedItems();
                        if (!fBarView->Vertical()) {
                                // Must also resize the Deskbar menu and 
replicant tray in
                                // horizontal mode
@@ -588,10 +619,6 @@ TBarApp::MessageReceived(BMessage* message)
                        }
                        fBarView->PlaceApplicationBar();
                        fBarWindow->Unlock();
-
-                       if (fPreferencesWindow != NULL)
-                               
fPreferencesWindow->PostMessage(kUpdatePreferences);
-
                        break;
                }
 


Other related posts: