Patch by John Scipione:

"Show Application Expander" and "Expand New Applications" in the Deskbar preferences only work in Expando mode, however, this is not communicated to the user. This ticket contains a patch which disables these options in the preference window when not in expando mode and re-enables them in expando mode.
This fixes ticket #7177.
 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40326 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Fredrik Holmqvist 2011-01-30 19:54:18 +00:00
parent ee5ecb929e
commit 38bda6536f
4 changed files with 27 additions and 5 deletions

View File

@ -334,6 +334,10 @@ TBarApp::MessageReceived(BMessage* message)
ShowPreferencesWindow(); ShowPreferencesWindow();
break; break;
case kStateChanged:
fPreferencesWindow->PostMessage(kStateChanged);
break;
case kShowBeMenu: case kShowBeMenu:
if (fBarWindow->Lock()) { if (fBarWindow->Lock()) {
fBarWindow->ShowBeMenu(); fBarWindow->ShowBeMenu();

View File

@ -130,10 +130,10 @@ void
TBarView::Draw(BRect) TBarView::Draw(BRect)
{ {
BRect bounds(Bounds()); BRect bounds(Bounds());
rgb_color hilite = tint_color(ViewColor(), B_DARKEN_1_TINT); rgb_color hilite = tint_color(ViewColor(), B_DARKEN_1_TINT);
rgb_color light = tint_color(ViewColor(), B_LIGHTEN_2_TINT); rgb_color light = tint_color(ViewColor(), B_LIGHTEN_2_TINT);
SetHighColor(hilite); SetHighColor(hilite);
if (AcrossTop()) if (AcrossTop())
StrokeLine(bounds.LeftBottom(), bounds.RightBottom()); StrokeLine(bounds.LeftBottom(), bounds.RightBottom());
@ -433,12 +433,20 @@ TBarView::ChangeState(int32 state, bool vertical, bool left, bool top)
{ {
bool vertSwap = (fVertical != vertical); bool vertSwap = (fVertical != vertical);
bool leftSwap = (fLeft != left); bool leftSwap = (fLeft != left);
bool stateChanged = (fState != state);
fState = state; fState = state;
fVertical = vertical; fVertical = vertical;
fLeft = left; fLeft = left;
fTop = top; fTop = top;
// Send a message to the preferences window to let it know to enable
// or disabled preference items
if (stateChanged || vertSwap) {
BMessage message(kStateChanged);
be_app->PostMessage(&message);
}
BRect screenFrame = (BScreen(Window())).Frame(); BRect screenFrame = (BScreen(Window())).Frame();
PlaceBeMenu(); PlaceBeMenu();

View File

@ -242,6 +242,10 @@ PreferencesWindow::MessageReceived(BMessage* message)
be_app->PostMessage(message); be_app->PostMessage(message);
break; break;
case kStateChanged:
_EnableDisableDependentItems();
break;
default: default:
BWindow::MessageReceived(message); BWindow::MessageReceived(message);
break; break;
@ -275,10 +279,15 @@ PreferencesWindow::_UpdateRecentCounts()
void void
PreferencesWindow::_EnableDisableDependentItems() PreferencesWindow::_EnableDisableDependentItems()
{ {
if (fAppsShowExpanders->Value()) TBarApp* barApp = static_cast<TBarApp*>(be_app);
fAppsExpandNew->SetEnabled(true); if (barApp->BarView()->Vertical()
else && barApp->BarView()->Expando()) {
fAppsShowExpanders->SetEnabled(true);
fAppsExpandNew->SetEnabled(fAppsShowExpanders->Value());
} else {
fAppsShowExpanders->SetEnabled(false);
fAppsExpandNew->SetEnabled(false); fAppsExpandNew->SetEnabled(false);
}
if (fMenuRecentDocuments->Value()) if (fMenuRecentDocuments->Value())
fMenuRecentDocumentCount->SetEnabled(true); fMenuRecentDocumentCount->SetEnabled(true);

View File

@ -19,6 +19,7 @@ const uint32 kConfigShow = 'show';
const uint32 kConfigClose = 'canc'; const uint32 kConfigClose = 'canc';
const uint32 kUpdateRecentCounts = 'upct'; const uint32 kUpdateRecentCounts = 'upct';
const uint32 kEditMenuInTracker = 'mtrk'; const uint32 kEditMenuInTracker = 'mtrk';
const uint32 kStateChanged = 'stch';
class PreferencesWindow : public BWindow class PreferencesWindow : public BWindow