Ticket #3746: 0002-Backgrounds-3746-Can-t-reset-default-background-colo.patch

File 0002-Backgrounds-3746-Can-t-reset-default-background-colo.patch, 1.9 KB (added by valzant, 7 years ago)
  • src/preferences/backgrounds/BackgroundsView.cpp

    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';  
    6464static const uint32 kMsgImagePlacement = 'xypl';
    6565static const uint32 kMsgUpdatePreviewPlacement = 'pvpl';
    6666
     67static const rgb_color kDefaultColor = {51, 102, 152, 255};
     68
    6769
    6870BackgroundsView::BackgroundsView()
    6971    :
    BackgroundsView::BackgroundsView()  
    240242            .End()
    241243        .AddGroup(B_HORIZONTAL, 0)
    242244            .Add(fDefaults)
     245            .AddStrut(B_USE_DEFAULT_SPACING)
    243246            .Add(fRevert)
    244247            .AddGlue()
    245248            .Add(fApply)
    BackgroundsView::AllAttached()  
    298301    }
    299302
    300303    fApply->SetEnabled(false);
    301     fDefaults->SetEnabled(false);
     304    fDefaults->SetEnabled(true);
    302305    fRevert->SetEnabled(false);
    303306}
    304307
    BackgroundsView::MessageReceived(BMessage* message)  
    435438
    436439        case kMsgDefaultSettings:
    437440        {
    438             rgb_color color = {51, 102, 152, 255};
    439             fPicker->SetValue(color);
     441            fPicker->SetValue(kDefaultColor);
    440442
    441443            _UpdatePreview();
    442444            _UpdateButtons();
    BackgroundsView::_UpdateButtons()  
    984986    }
    985987
    986988    fApply->SetEnabled(hasChanged);
    987     fDefaults->SetEnabled(hasChanged);
     989    fDefaults->SetEnabled(true);
    988990    fRevert->SetEnabled(hasChanged);
    989991}
    990992