Commit 6c0270bb authored by Benjamin Otte's avatar Benjamin Otte

win32 theme: Make tooltips look right

Includes adding fallback support
parent 808017d1
......@@ -234,6 +234,25 @@ draw_window_button (cairo_t *cr,
mask_icon (cr, icon, 1, 1, width - 2, height - 2);
}
static void
draw_tooltip (cairo_t *cr,
int part,
int state,
int width,
int height)
{
int xborder = gtk_win32_get_sys_metric (GTK_WIN32_SYS_METRIC_CXDLGFRAME) -
gtk_win32_get_sys_metric (GTK_WIN32_SYS_METRIC_CXEDGE);
int yborder = gtk_win32_get_sys_metric (GTK_WIN32_SYS_METRIC_CYDLGFRAME) -
gtk_win32_get_sys_metric (GTK_WIN32_SYS_METRIC_CYEDGE);
cairo_rectangle (cr, 0, 0, width, height);
cairo_rectangle (cr, width - xborder, yborder,
- (width - 2 * xborder), height - 2 * yborder);
gtk_cairo_set_source_sys_color (cr, GTK_WIN32_SYS_COLOR_WINDOWFRAME);
cairo_fill (cr);
}
typedef struct _GtkWin32ThemePart GtkWin32ThemePart;
struct _GtkWin32ThemePart {
const char *class_name;
......@@ -251,6 +270,7 @@ static GtkWin32ThemePart theme_parts[] = {
{ "button", 1, 0, { 3, 3, 3, 3 }, draw_button },
{ "button", 2, 13, { 0, 0, 0, 0 }, draw_radio },
{ "button", 3, 13, { 0, 0, 0, 0 }, draw_check },
{ "tooltip", 1, 0, { 0, 0, 0, 0 }, draw_tooltip },
{ "window", 1, 0, { 0, 0, 0, 0 }, draw_window },
{ "window", 15, 0, { 0, 0, 0, 0 }, draw_window_button },
{ "window", 17, 0, { 0, 0, 0, 0 }, draw_window_button },
......
......@@ -117,15 +117,11 @@ scrolledwindow.frame {
color: @selected_fg_color;
}
tooltip {
background-color: transparent;
background-image: -gtk-win32-theme-part(tooltip, 3, 1);
color: -gtk-win32-color(button, infotext);
border-width: 0px;
}
tooltip * {
tooltip, tooltip.background {
background-color: -gtk-win32-color(tooltip, infobk);
background-image: -gtk-win32-theme-part(tooltip, 1, 1);
color: -gtk-win32-color(button, infotext);
padding: 2px;
}
assistant .sidebar .highlight {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment