Skip to content

Commit

Permalink
Fix WindowsXP flatbutton drawing
Browse files Browse the repository at this point in the history
  • Loading branch information
frang75 committed Apr 5, 2024
1 parent 8b1fecc commit adbb2db
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
5 changes: 2 additions & 3 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
### Fixed

* WindowsXP TableView/ListBox select colors. [Commit](https://github.com/frang75/nappgui_src/commit/fd0983ff06cbea190a543e9f119e749c436b954d).

* macOS TableView/ListBox select colors. [Issue](https://github.com/frang75/nappgui_src/issues/115). [Commit](https://github.com/frang75/nappgui_src/commit/7485964f68e5647c5a31e267ce3a8d2b059ca031).
* WindowsXP flat buttons drawing.

### Removed

* `guicontrol_enabled()` and `guicontrol_visible()` because unsafe. Use `cell_enabled()`, `cell_visible()`.
* `guicontrol_enabled()` and `guicontrol_visible()` because unsafe. Use `cell_enabled()`, `cell_visible()`. [Commit](https://github.com/frang75/nappgui_src/commit/8b1fecce6a44adffc827c1fd55fbd86d72f71ad9).

### Improved

* `gui_text_t` properties in private API. [Commit](https://github.com/frang75/nappgui_src/commit/579766ab451eb445ce5013a93892261997137706).

* `str_splits()` adds a new `add_empty` parameter. [Issue](https://github.com/frang75/nappgui_src/issues/124). [Doc](https://nappgui.com/en/core/string.html#f52). [Commit](https://github.com/frang75/nappgui_src/commit/845c4c01ca282abbe6751ed51cb6a28b1860076f).

## v1.4.1 - Apr 3, 2024 (r4993)
Expand Down
2 changes: 1 addition & 1 deletion prj/build.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5016
5019
2 changes: 1 addition & 1 deletion src/osgui/osx/osglobals.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static void i_theme_colors(void)
#endif
oscolor_NSColor_rgba_v([NSColor controlColor], i_HOTBG_COLOR);

/* Text background color in not active windows (normal, selected, mouse over */
/* Text background color in not active windows (normal, selected, mouse over) */
oscolor_NSColor_rgba_v([NSColor controlColor], i_BACKBACKDROP_COLOR);
#if defined(MAC_OS_X_VERSION_10_14) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_14
oscolor_NSColor_rgba_v([NSColor unemphasizedSelectedTextBackgroundColor], i_SELBGBACKDROP_COLOR);
Expand Down
11 changes: 10 additions & 1 deletion src/osgui/win/osbutton.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,16 @@ static void i_draw_flat_button(HWND hwnd, const Image *image)
state = TS_NORMAL;
}

osstyleXP_DrawThemeBackground(hwnd, hdc, TP_BUTTON, state, TRUE, &rect, &border);
/* WindowsXP draws nothing in TS_NORMAL (doesn't erase background) */
if (osbs_windows() > ekWIN_XP3 || state != TS_NORMAL)
{
osstyleXP_DrawThemeBackground(hwnd, hdc, TP_BUTTON, state, TRUE, &rect, &border);
}
else
{
HBRUSH brush = GetSysColorBrush(COLOR_BTNFACE);
FillRect(hdc, &rect, brush);
}
}
else
{
Expand Down

0 comments on commit adbb2db

Please sign in to comment.