Skip to content

Commit

Permalink
Restore display of color choice in configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
zao committed May 4, 2013
1 parent 5294db8 commit 79540b8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
18 changes: 10 additions & 8 deletions SeekbarWindow.ConfigDialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ namespace wave
bool override = sw.settings.override_colors[i];
CheckDlgButton(colors[i].use_id, override ? BST_CHECKED : BST_UNCHECKED);
colors[i].box.EnableWindow(override);
colors[i].box.InvalidateRect(0);
}

// Set up misc settings
Expand Down Expand Up @@ -151,9 +150,13 @@ namespace wave
return 0;
for (int i = 0; i < config::color_count; ++i)
if (wnd == colors[i].box)
return colors[i].box.IsWindowEnabled()
? colors[i].brush
{
bool enabled = !!colors[i].box.IsWindowEnabled();
dc.SetDCBrushColor(colors[i].color_ref);
return enabled
? (HBRUSH)GetStockObject(DC_BRUSH)
: GetSysColorBrush(COLOR_BTNFACE);
}
return 0;
}

Expand Down Expand Up @@ -191,11 +194,10 @@ namespace wave

if (ChooseColor(&cc))
{
ci.brush.DeleteObject();
ci.brush.CreateSolidBrush(cc.rgbResult);
ci.box.InvalidateRect(0);
ci.color = xbgr_to_color(cc.rgbResult);
ci.color_ref = cc.rgbResult;
sw.set_color(idx, ci.color, true);
ci.box.InvalidateRect(0);
}
}

Expand Down Expand Up @@ -224,7 +226,7 @@ namespace wave
bool override = !!IsDlgButtonChecked(id);
sw.set_color_override(idx, override);
colors[idx].box.EnableWindow(override);
colors[idx].box.InvalidateRect(0);
colors[idx].box.Invalidate();
}

void seekbar_window::configuration_dialog::on_display_select(UINT code, int id, CWindow control)
Expand Down Expand Up @@ -363,7 +365,7 @@ namespace wave
color_info& ci = colors[what];

ci.box = GetDlgItem(display_id);
ci.brush.CreateSolidBrush(color_to_xbgr(c));
ci.color_ref = color_to_xbgr(c);
ci.color = c;
ci.display_id = display_id;
ci.use_id = use_id;
Expand Down
2 changes: 1 addition & 1 deletion SeekbarWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ namespace wave
struct color_info
{
CStatic box;
CBrush brush;
color color;
COLORREF color_ref;
UINT display_id;
UINT use_id;
};
Expand Down
7 changes: 0 additions & 7 deletions resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,15 @@
#define IDC_COLOR_FOREGROUND 1005
#define IDC_COLOR_HIGHLIGHT 1006
#define IDC_COLOR_SELECTION 1007
#define IDC_PICK_BACKGROUND 1008
#define IDC_PICK_HIGHLIGHT 1009
#define IDC_USE_BACKGROUND 1009
#define IDC_PICK_SELECTION 1010
#define IDC_USE_FOREGROUND 1010
#define IDC_PICK_FOREGROUND 1011
#define IDC_USE_HIGHLIGHT 1011
#define IDC_USE_SELECTION 1012
#define IDC_SHADEPLAYED 1013
#define IDC_CHANNEL_ADD 1018
#define IDC_DISPLAYMODE 1024
#define IDC_DOWNMIX 1025
#define IDC_MIRROR_DISPLAY 1026
#define IDC_MIRRORDISPLAY 1026
#define IDC_USED_CHANNELS 1027
#define IDC_CHANNELS 1027
#define IDC_CHANNEL_UP 1030
#define IDC_CHANNEL_DOWN 1031
Expand All @@ -37,7 +31,6 @@
#define IDC_EFFECT_SOURCE 1035
#define IDC_EFFECT_ERRORS 1036
#define IDC_EFFECT_RESET 1037
#define IDC_BUTTON2 1038
#define IDC_EFFECT_DEFAULT 1038

// Next default values for new objects
Expand Down

0 comments on commit 79540b8

Please sign in to comment.