From 05d62d483834144786386d9cb28269e20ec2e7f0 Mon Sep 17 00:00:00 2001
From: Valzant <qisoster@gmail.com>
Date: Thu, 5 Jan 2017 03:15:26 +0000
Subject: [PATCH 2/2] Backgrounds: #3746 Can't reset default background colour
in Screen Preferences
* Created constant for default color.
* Added padding between 'Defaults' and 'Revert' buttons.
* Made 'Defaults' button always enabled.
---
src/preferences/backgrounds/BackgroundsView.cpp | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/preferences/backgrounds/BackgroundsView.cpp b/src/preferences/backgrounds/BackgroundsView.cpp
index c5fc04a..7ab9168 100644
a
|
b
|
static const uint32 kMsgIconLabelOutline = 'ilol';
|
64 | 64 | static const uint32 kMsgImagePlacement = 'xypl'; |
65 | 65 | static const uint32 kMsgUpdatePreviewPlacement = 'pvpl'; |
66 | 66 | |
| 67 | static const rgb_color kDefaultColor = {51, 102, 152, 255}; |
| 68 | |
67 | 69 | |
68 | 70 | BackgroundsView::BackgroundsView() |
69 | 71 | : |
… |
… |
BackgroundsView::BackgroundsView()
|
240 | 242 | .End() |
241 | 243 | .AddGroup(B_HORIZONTAL, 0) |
242 | 244 | .Add(fDefaults) |
| 245 | .AddStrut(B_USE_DEFAULT_SPACING) |
243 | 246 | .Add(fRevert) |
244 | 247 | .AddGlue() |
245 | 248 | .Add(fApply) |
… |
… |
BackgroundsView::AllAttached()
|
298 | 301 | } |
299 | 302 | |
300 | 303 | fApply->SetEnabled(false); |
301 | | fDefaults->SetEnabled(false); |
| 304 | fDefaults->SetEnabled(true); |
302 | 305 | fRevert->SetEnabled(false); |
303 | 306 | } |
304 | 307 | |
… |
… |
BackgroundsView::MessageReceived(BMessage* message)
|
435 | 438 | |
436 | 439 | case kMsgDefaultSettings: |
437 | 440 | { |
438 | | rgb_color color = {51, 102, 152, 255}; |
439 | | fPicker->SetValue(color); |
| 441 | fPicker->SetValue(kDefaultColor); |
440 | 442 | |
441 | 443 | _UpdatePreview(); |
442 | 444 | _UpdateButtons(); |
… |
… |
BackgroundsView::_UpdateButtons()
|
984 | 986 | } |
985 | 987 | |
986 | 988 | fApply->SetEnabled(hasChanged); |
987 | | fDefaults->SetEnabled(hasChanged); |
| 989 | fDefaults->SetEnabled(true); |
988 | 990 | fRevert->SetEnabled(hasChanged); |
989 | 991 | } |
990 | 992 | |