Skip to content

Commit

Permalink
Use the correct observer for disabling the default-bg-transparency bu…
Browse files Browse the repository at this point in the history
…tton. The wrong one worked because reloadProfiles triggers all the observers :(. Also disable the blur-related things when transparency is off.
  • Loading branch information
gnachman committed Apr 22, 2016
1 parent 0d90c3e commit 3d8f563
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions sources/ProfilesWindowPreferencesViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,15 @@ - (void)awakeFromNib {
object:nil];

PreferenceInfo *info;
[self defineControl:_transparency
key:KEY_TRANSPARENCY
type:kPreferenceInfoTypeSlider];
info = [self defineControl:_transparency
key:KEY_TRANSPARENCY
type:kPreferenceInfoTypeSlider];
info.observer = ^() {
BOOL haveTransparency = (_transparency.doubleValue > 0);
_transparencyAffectsOnlyDefaultBackgroundColor.enabled = haveTransparency;
_blurRadius.enabled = haveTransparency;
_useBlur.enabled = haveTransparency;
};

info = [self defineControl:_useBlur
key:KEY_BLUR
Expand Down Expand Up @@ -123,7 +129,6 @@ - (void)awakeFromNib {
info = [self defineControl:_transparencyAffectsOnlyDefaultBackgroundColor
key:KEY_TRANSPARENCY_AFFECTS_ONLY_DEFAULT_BACKGROUND_COLOR
type:kPreferenceInfoTypeCheckbox];
info.observer = ^() { _transparencyAffectsOnlyDefaultBackgroundColor.enabled = (_transparency.doubleValue > 0); };

[self defineControl:_openToolbelt
key:KEY_OPEN_TOOLBELT
Expand Down

0 comments on commit 3d8f563

Please sign in to comment.