summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/gtkui/callbacks.c11
-rw-r--r--plugins/gtkui/callbacks.h60
-rw-r--r--plugins/gtkui/ddblistview.c34
-rw-r--r--plugins/gtkui/ddbtabstrip.c36
-rw-r--r--plugins/gtkui/ddbvolumebar.c4
-rw-r--r--plugins/gtkui/deadbeef.glade556
-rw-r--r--plugins/gtkui/drawing.h37
-rw-r--r--plugins/gtkui/gdkdrawing.c177
-rw-r--r--plugins/gtkui/gtkui.c32
-rw-r--r--plugins/gtkui/gtkui.h12
-rw-r--r--plugins/gtkui/interface.c394
-rw-r--r--plugins/gtkui/plcommon.c28
-rw-r--r--plugins/gtkui/prefwin.c183
13 files changed, 1072 insertions, 492 deletions
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c
index d8a71714..cacba4b0 100644
--- a/plugins/gtkui/callbacks.c
+++ b/plugins/gtkui/callbacks.c
@@ -491,8 +491,8 @@ seekbar_draw (GtkWidget *widget) {
if (!cr) {
return;
}
- GdkColor *clr_selection = gtkui_get_selection_color ();
- GdkColor *clr_back = gtkui_get_back_color ();
+ GdkColor *clr_selection = gtkui_get_bar_foreground_color ();
+ GdkColor *clr_back = gtkui_get_bar_background_color ();
DB_playItem_t *trk = deadbeef->streamer_get_playing_track ();
if (!trk || deadbeef->pl_get_item_duration (trk) < 0) {
@@ -624,6 +624,13 @@ on_seekbar_button_release_event (GtkWidget *widget,
return FALSE;
}
+void
+seekbar_redraw (void) {
+ GtkWidget *widget = lookup_widget (mainwin, "seekbar");
+ seekbar_draw (widget);
+ seekbar_expose (widget, 0, 0, widget->allocation.width, widget->allocation.height);
+}
+
gboolean
on_mainwin_delete_event (GtkWidget *widget,
GdkEvent *event,
diff --git a/plugins/gtkui/callbacks.h b/plugins/gtkui/callbacks.h
index 530bed31..876bfa2f 100644
--- a/plugins/gtkui/callbacks.h
+++ b/plugins/gtkui/callbacks.h
@@ -853,3 +853,63 @@ on_mmb_delete_playlist_toggled (GtkToggleButton *togglebutton,
void
on_new_playlist1_activate (GtkMenuItem *menuitem,
gpointer user_data);
+
+void
+on_override_bar_colors_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data);
+
+void
+on_bar_foreground_color_set (GtkColorButton *colorbutton,
+ gpointer user_data);
+
+void
+on_bar_background_color_set (GtkColorButton *colorbutton,
+ gpointer user_data);
+
+void
+on_tabstrip_mid_color_set (GtkColorButton *colorbutton,
+ gpointer user_data);
+
+void
+on_tabstrip_light_color_set (GtkColorButton *colorbutton,
+ gpointer user_data);
+
+void
+on_tabstrip_dark_color_set (GtkColorButton *colorbutton,
+ gpointer user_data);
+
+void
+on_tabstrip_base_color_set (GtkColorButton *colorbutton,
+ gpointer user_data);
+
+void
+on_override_tabstrip_colors_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data);
+
+void
+on_override_listview_colors_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data);
+
+void
+on_listview_even_row_color_set (GtkColorButton *colorbutton,
+ gpointer user_data);
+
+void
+on_listview_odd_row_color_set (GtkColorButton *colorbutton,
+ gpointer user_data);
+
+void
+on_listview_selected_row_color_set (GtkColorButton *colorbutton,
+ gpointer user_data);
+
+void
+on_listview_text_color_set (GtkColorButton *colorbutton,
+ gpointer user_data);
+
+void
+on_listview_selected_text_color_set (GtkColorButton *colorbutton,
+ gpointer user_data);
+
+void
+on_listview_cursor_color_set (GtkColorButton *colorbutton,
+ gpointer user_data);
diff --git a/plugins/gtkui/ddblistview.c b/plugins/gtkui/ddblistview.c
index c802b75b..8a417ce6 100644
--- a/plugins/gtkui/ddblistview.c
+++ b/plugins/gtkui/ddblistview.c
@@ -1127,7 +1127,7 @@ void
ddb_listview_list_render_row_background (DdbListview *ps, DdbListviewIter it, int even, int cursor, int x, int y, int w, int h) {
// draw background
GtkWidget *treeview = theme_treeview;
- int theming = !gtkui_listview_theming_disabled ();
+ int theming = !gtkui_override_listview_colors ();
if (theming) {
if (treeview->style->depth == -1) {
@@ -1135,23 +1135,39 @@ ddb_listview_list_render_row_background (DdbListview *ps, DdbListviewIter it, in
}
GTK_OBJECT_FLAGS (treeview) |= GTK_HAS_FOCUS;
}
- if (it && ps->binding->is_selected(it)) {
+ int sel = it && ps->binding->is_selected (it);
+ if (theming || !sel) {
if (theming) {
// draw background for selection -- workaround for New Wave theme (translucency)
gtk_paint_flat_box (treeview->style, ps->backbuf, GTK_STATE_NORMAL, GTK_SHADOW_NONE, NULL, treeview, even ? "cell_even_ruled" : "cell_odd_ruled", x, y, w, h);
}
+ else {
+ GdkGC *gc = gdk_gc_new (ps->backbuf);
+ gdk_gc_set_rgb_fg_color (gc, even ? gtkui_get_listview_even_row_color () : gtkui_get_listview_odd_row_color ());
+ gdk_draw_rectangle (ps->backbuf, gc, TRUE, x, y, w, h);
+ g_object_unref (gc);
+ }
}
- if (theming) {
- gtk_paint_flat_box (treeview->style, ps->backbuf, (it && ps->binding->is_selected(it)) ? GTK_STATE_SELECTED : GTK_STATE_NORMAL, GTK_SHADOW_NONE, NULL, treeview, even ? "cell_even_ruled" : "cell_odd_ruled", x, y, w, h);
+
+ if (sel) {
+ if (theming) {
+ gtk_paint_flat_box (treeview->style, ps->backbuf, GTK_STATE_SELECTED, GTK_SHADOW_NONE, NULL, treeview, even ? "cell_even_ruled" : "cell_odd_ruled", x, y, w, h);
+ }
+ else {
+ GdkGC *gc = gdk_gc_new (ps->backbuf);
+ gdk_gc_set_rgb_fg_color (gc, gtkui_get_listview_selection_color ());
+ gdk_draw_rectangle (ps->backbuf, gc, TRUE, x, y, w, h);
+ g_object_unref (gc);
+ }
}
-// else {
-// GdkColor *clr_
-// gtk_draw_rectangle (ps->backbuf, gc);
-// }
if (cursor) {
// not all gtk engines/themes render focus rectangle in treeviews
// but we want it anyway
- gdk_draw_rectangle (ps->backbuf, treeview->style->fg_gc[GTK_STATE_NORMAL], FALSE, x, y, w-1, h-1);
+ //treeview->style->fg_gc[GTK_STATE_NORMAL]
+ GdkGC *gc = gdk_gc_new (ps->backbuf);
+ gdk_gc_set_rgb_fg_color (gc, gtkui_get_listview_cursor_color ());
+ gdk_draw_rectangle (ps->backbuf, gc, FALSE, x, y, w-1, h-1);
+ g_object_unref (gc);
}
}
diff --git a/plugins/gtkui/ddbtabstrip.c b/plugins/gtkui/ddbtabstrip.c
index b9b17cd5..af04abc7 100644
--- a/plugins/gtkui/ddbtabstrip.c
+++ b/plugins/gtkui/ddbtabstrip.c
@@ -214,22 +214,31 @@ ddb_tabstrip_draw_tab (GtkWidget *widget, GdkDrawable *drawable, int selected, i
{ x + w-2, y + h - 2 },
};
//gdk_draw_rectangle (widget->window, widget->style->black_gc, FALSE, x-1, y-1, w+2, h+2);
- GdkGC *bg;
- GdkGC *outer_frame;
- GdkGC *inner_frame;
+ GdkGC *bg = gdk_gc_new (drawable);
+ GdkGC *outer_frame = gdk_gc_new (drawable);
+ GdkGC *inner_frame = gdk_gc_new (drawable);
if (selected) {
- bg = widget->style->bg_gc[GTK_STATE_NORMAL];
- outer_frame = widget->style->dark_gc[GTK_STATE_NORMAL];
- inner_frame = widget->style->light_gc[GTK_STATE_NORMAL];
+ gdk_gc_set_rgb_fg_color (bg, gtkui_get_tabstrip_base_color ());//&widget->style->bg[GTK_STATE_NORMAL]); // FIXME: need base color
+ gdk_gc_set_rgb_fg_color (outer_frame, gtkui_get_tabstrip_dark_color ());
+ gdk_gc_set_rgb_fg_color (inner_frame, gtkui_get_tabstrip_light_color ());
+// bg = widget->style->bg_gc[GTK_STATE_NORMAL];
+// outer_frame = widget->style->dark_gc[GTK_STATE_NORMAL];
+// inner_frame = widget->style->light_gc[GTK_STATE_NORMAL];
}
else {
- bg = widget->style->mid_gc[GTK_STATE_NORMAL];
- outer_frame = widget->style->dark_gc[GTK_STATE_NORMAL];
- inner_frame = widget->style->mid_gc[GTK_STATE_NORMAL];
+ gdk_gc_set_rgb_fg_color (bg, gtkui_get_tabstrip_mid_color ());
+ gdk_gc_set_rgb_fg_color (outer_frame, gtkui_get_tabstrip_dark_color ());
+ gdk_gc_set_rgb_fg_color (inner_frame, gtkui_get_tabstrip_mid_color ());
+// bg = widget->style->mid_gc[GTK_STATE_NORMAL];
+// outer_frame = widget->style->dark_gc[GTK_STATE_NORMAL];
+// inner_frame = widget->style->mid_gc[GTK_STATE_NORMAL];
}
gdk_draw_polygon (drawable, bg, TRUE, points_filled, 4);
gdk_draw_lines (drawable, outer_frame, points_frame1, 9);
gdk_draw_lines (drawable, inner_frame, points_frame2, 7);
+ g_object_unref (bg);
+ g_object_unref (outer_frame);
+ g_object_unref (inner_frame);
}
int
@@ -262,9 +271,13 @@ tabstrip_render (DdbTabStrip *ts) {
int cnt = deadbeef->plt_get_count ();
int tab_selected = deadbeef->plt_get_curr ();
+ GdkGC *gc = gdk_gc_new (backbuf);
+
// fill background
- gdk_draw_rectangle (backbuf, widget->style->mid_gc[GTK_STATE_NORMAL], TRUE, 0, 0, widget->allocation.width, widget->allocation.height);
- gdk_draw_line (backbuf, widget->style->dark_gc[GTK_STATE_NORMAL], 0, 0, widget->allocation.width, 0);
+ gdk_gc_set_rgb_fg_color (gc, gtkui_get_tabstrip_mid_color ());
+ gdk_draw_rectangle (backbuf, gc, TRUE, 0, 0, widget->allocation.width, widget->allocation.height);
+ gdk_gc_set_rgb_fg_color (gc, gtkui_get_tabstrip_dark_color ());
+ gdk_draw_line (backbuf, gc, 0, 0, widget->allocation.width, 0);
int y = 4;
h = widget->allocation.height - 4;
draw_begin ((uintptr_t)backbuf);
@@ -366,6 +379,7 @@ tabstrip_render (DdbTabStrip *ts) {
}
}
draw_end ();
+ g_object_unref (gc);
}
void
diff --git a/plugins/gtkui/ddbvolumebar.c b/plugins/gtkui/ddbvolumebar.c
index 4d2654a0..3b48cf95 100644
--- a/plugins/gtkui/ddbvolumebar.c
+++ b/plugins/gtkui/ddbvolumebar.c
@@ -182,10 +182,10 @@ volumebar_draw (GtkWidget *widget) {
float h = 17;
GdkGC *back_gc = gdk_gc_new (widget->window);
- gdk_gc_set_rgb_fg_color (back_gc, gtkui_get_back_color ());
+ gdk_gc_set_rgb_fg_color (back_gc, gtkui_get_bar_background_color ());
GdkGC *front_gc = gdk_gc_new (widget->window);
- gdk_gc_set_rgb_fg_color (front_gc, gtkui_get_selection_color ());
+ gdk_gc_set_rgb_fg_color (front_gc, gtkui_get_bar_foreground_color ());
for (int i = 0; i < n; i++) {
float iy = (float)i + 3;
diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade
index 7afb12ef..89f682ab 100644
--- a/plugins/gtkui/deadbeef.glade
+++ b/plugins/gtkui/deadbeef.glade
@@ -2268,81 +2268,118 @@ Album</property>
</child>
<child>
- <widget class="GtkFrame" id="frame3">
+ <widget class="GtkNotebook" id="notebook4">
<property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="can_focus">True</property>
+ <property name="show_tabs">True</property>
+ <property name="show_border">True</property>
+ <property name="tab_pos">GTK_POS_TOP</property>
+ <property name="scrollable">False</property>
+ <property name="enable_popup">False</property>
<child>
- <widget class="GtkAlignment" id="alignment1">
+ <widget class="GtkVBox" id="vbox21">
+ <property name="border_width">12</property>
<property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
- <property name="top_padding">0</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">12</property>
- <property name="right_padding">0</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">8</property>
<child>
- <widget class="GtkTable" id="colors_table">
- <property name="border_width">12</property>
+ <widget class="GtkCheckButton" id="override_bar_colors">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Override</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_override_bar_colors_toggled" last_modification_time="Sat, 03 Apr 2010 14:45:11 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkTable" id="bar_colors_group">
<property name="visible">True</property>
<property name="n_rows">2</property>
- <property name="n_columns">5</property>
+ <property name="n_columns">2</property>
<property name="homogeneous">True</property>
<property name="row_spacing">0</property>
<property name="column_spacing">8</property>
<child>
- <widget class="GtkColorButton" id="color_light">
+ <widget class="GtkLabel" id="label43">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="use_alpha">False</property>
- <property name="focus_on_click">True</property>
- <signal name="color_set" handler="on_color_light_color_set" last_modification_time="Tue, 09 Mar 2010 19:11:31 GMT"/>
+ <property name="label" translatable="yes">Foreground</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
<property name="x_options">expand</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkColorButton" id="color_mid">
+ <widget class="GtkLabel" id="label47">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="use_alpha">False</property>
- <property name="focus_on_click">True</property>
- <signal name="color_set" handler="on_color_mid_color_set" last_modification_time="Tue, 09 Mar 2010 19:11:27 GMT"/>
+ <property name="label" translatable="yes">Background</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
<property name="x_options">expand</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkColorButton" id="color_dark">
+ <widget class="GtkColorButton" id="bar_foreground">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="use_alpha">False</property>
<property name="focus_on_click">True</property>
- <signal name="color_set" handler="on_color_dark_color_set" last_modification_time="Tue, 09 Mar 2010 19:11:22 GMT"/>
+ <signal name="color_set" handler="on_bar_foreground_color_set" last_modification_time="Sat, 03 Apr 2010 15:31:16 GMT"/>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">expand</property>
@@ -2351,27 +2388,99 @@ Album</property>
</child>
<child>
- <widget class="GtkColorButton" id="color_selection">
+ <widget class="GtkColorButton" id="bar_background">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="use_alpha">False</property>
<property name="focus_on_click">True</property>
- <signal name="color_set" handler="on_color_selection_color_set" last_modification_time="Tue, 09 Mar 2010 19:11:16 GMT"/>
+ <signal name="color_set" handler="on_bar_background_color_set" last_modification_time="Sat, 03 Apr 2010 15:31:27 GMT"/>
</widget>
<packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">expand</property>
<property name="y_options"></property>
</packing>
</child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="tab_expand">False</property>
+ <property name="tab_fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label73">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Seekbar/Volumebar colors</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox22">
+ <property name="border_width">12</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">8</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="override_tabstrip_colors">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Override</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_override_tabstrip_colors_toggled" last_modification_time="Sat, 03 Apr 2010 15:37:38 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkTable" id="tabstrip_colors_group">
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">4</property>
+ <property name="homogeneous">True</property>
+ <property name="row_spacing">0</property>
+ <property name="column_spacing">8</property>
<child>
- <widget class="GtkLabel" id="label43">
+ <widget class="GtkLabel" id="label45">
<property name="visible">True</property>
- <property name="label" translatable="yes">Selection</property>
+ <property name="label" translatable="yes">Middle</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -2397,9 +2506,9 @@ Album</property>
</child>
<child>
- <widget class="GtkLabel" id="label44">
+ <widget class="GtkLabel" id="label46">
<property name="visible">True</property>
- <property name="label" translatable="yes">Dark</property>
+ <property name="label" translatable="yes">Light</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -2425,9 +2534,9 @@ Album</property>
</child>
<child>
- <widget class="GtkLabel" id="label45">
+ <widget class="GtkLabel" id="label44">
<property name="visible">True</property>
- <property name="label" translatable="yes">Middle</property>
+ <property name="label" translatable="yes">Dark</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -2453,44 +2562,34 @@ Album</property>
</child>
<child>
- <widget class="GtkLabel" id="label46">
+ <widget class="GtkColorButton" id="tabstrip_mid">
<property name="visible">True</property>
- <property name="label" translatable="yes">Light</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
+ <property name="can_focus">True</property>
+ <property name="use_alpha">False</property>
+ <property name="focus_on_click">True</property>
+ <signal name="color_set" handler="on_tabstrip_mid_color_set" last_modification_time="Sat, 03 Apr 2010 15:33:34 GMT"/>
</widget>
<packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">expand</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkColorButton" id="color_back">
+ <widget class="GtkColorButton" id="tabstrip_light">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="use_alpha">False</property>
<property name="focus_on_click">True</property>
- <signal name="color_set" handler="on_color_back_color_set" last_modification_time="Tue, 09 Mar 2010 19:11:36 GMT"/>
+ <signal name="color_set" handler="on_tabstrip_light_color_set" last_modification_time="Sat, 03 Apr 2010 15:33:41 GMT"/>
</widget>
<packing>
- <property name="left_attach">4</property>
- <property name="right_attach">5</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">expand</property>
@@ -2499,9 +2598,45 @@ Album</property>
</child>
<child>
- <widget class="GtkLabel" id="label47">
+ <widget class="GtkColorButton" id="tabstrip_dark">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="use_alpha">False</property>
+ <property name="focus_on_click">True</property>
+ <signal name="color_set" handler="on_tabstrip_dark_color_set" last_modification_time="Sat, 03 Apr 2010 15:33:48 GMT"/>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">expand</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkColorButton" id="tabstrip_base">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="use_alpha">False</property>
+ <property name="focus_on_click">True</property>
+ <signal name="color_set" handler="on_tabstrip_base_color_set" last_modification_time="Sat, 03 Apr 2010 15:33:56 GMT"/>
+ </widget>
+ <packing>
+ <property name="left_attach">3</property>
+ <property name="right_attach">4</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">expand</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label76">
<property name="visible">True</property>
- <property name="label" translatable="yes">Inactive background</property>
+ <property name="label" translatable="yes">Base</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -2517,8 +2652,8 @@ Album</property>
<property name="angle">0</property>
</widget>
<packing>
- <property name="left_attach">4</property>
- <property name="right_attach">5</property>
+ <property name="left_attach">3</property>
+ <property name="right_attach">4</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">expand</property>
@@ -2526,60 +2661,74 @@ Album</property>
</packing>
</child>
</widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
</child>
</widget>
+ <packing>
+ <property name="tab_expand">False</property>
+ <property name="tab_fill">True</property>
+ </packing>
</child>
<child>
- <widget class="GtkCheckButton" id="override_theme_colors">
+ <widget class="GtkLabel" id="label74">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Override GTK+ theme colors in volume control and seek bar widgets</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_override_gtk_colors_toggled" last_modification_time="Tue, 09 Mar 2010 19:44:00 GMT"/>
+ <property name="label" translatable="yes">Tabstrip colors</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
- <property name="type">label_item</property>
+ <property name="type">tab</property>
</packing>
</child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame4">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
<child>
- <widget class="GtkAlignment" id="alignment2">
+ <widget class="GtkVBox" id="vbox23">
+ <property name="border_width">12</property>
<property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
- <property name="top_padding">0</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">12</property>
- <property name="right_padding">0</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">8</property>
<child>
- <widget class="GtkTable" id="listview_colors_table">
- <property name="border_width">12</property>
+ <widget class="GtkCheckButton" id="override_listview_colors">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Override (looses GTK treeview theming, but speeds up rendering)</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_override_listview_colors_toggled" last_modification_time="Sat, 03 Apr 2010 17:47:30 GMT"/>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkTable" id="listview_colors_group">
<property name="visible">True</property>
<property name="n_rows">2</property>
- <property name="n_columns">5</property>
+ <property name="n_columns">6</property>
<property name="homogeneous">True</property>
<property name="row_spacing">0</property>
<property name="column_spacing">8</property>
@@ -2641,37 +2790,45 @@ Album</property>
</child>
<child>
- <widget class="GtkLabel" id="label60">
+ <widget class="GtkColorButton" id="listview_even_row">
<property name="visible">True</property>
- <property name="label" translatable="yes">Text</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
+ <property name="can_focus">True</property>
+ <property name="use_alpha">False</property>
+ <property name="focus_on_click">True</property>
+ <signal name="color_set" handler="on_listview_even_row_color_set" last_modification_time="Sat, 03 Apr 2010 18:03:02 GMT"/>
</widget>
<packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">expand</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label61">
+ <widget class="GtkColorButton" id="listview_odd_row">
<property name="visible">True</property>
- <property name="label" translatable="yes">Selected text</property>
+ <property name="can_focus">True</property>
+ <property name="use_alpha">False</property>
+ <property name="focus_on_click">True</property>
+ <signal name="color_set" handler="on_listview_odd_row_color_set" last_modification_time="Sat, 03 Apr 2010 18:03:09 GMT"/>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">expand</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label77">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Text</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -2697,9 +2854,9 @@ Album</property>
</child>
<child>
- <widget class="GtkLabel" id="label62">
+ <widget class="GtkLabel" id="label78">
<property name="visible">True</property>
- <property name="label" translatable="yes">Cursor</property>
+ <property name="label" translatable="yes">Selected row</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -2715,8 +2872,8 @@ Album</property>
<property name="angle">0</property>
</widget>
<packing>
- <property name="left_attach">4</property>
- <property name="right_attach">5</property>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">expand</property>
@@ -2725,16 +2882,16 @@ Album</property>
</child>
<child>
- <widget class="GtkColorButton" id="color_even_row">
+ <widget class="GtkColorButton" id="listview_selected_row">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="use_alpha">False</property>
<property name="focus_on_click">True</property>
- <signal name="color_set" handler="on_color_even_row_color_set" last_modification_time="Wed, 10 Mar 2010 21:17:16 GMT"/>
+ <signal name="color_set" handler="on_listview_selected_row_color_set" last_modification_time="Sat, 03 Apr 2010 18:03:15 GMT"/>
</widget>
<packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">expand</property>
@@ -2743,16 +2900,16 @@ Album</property>
</child>
<child>
- <widget class="GtkColorButton" id="color_odd_row">
+ <widget class="GtkColorButton" id="listview_text">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="use_alpha">False</property>
<property name="focus_on_click">True</property>
- <signal name="color_set" handler="on_color_odd_row_color_set" last_modification_time="Wed, 10 Mar 2010 21:17:20 GMT"/>
+ <signal name="color_set" handler="on_listview_text_color_set" last_modification_time="Sat, 03 Apr 2010 18:03:22 GMT"/>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
+ <property name="left_attach">3</property>
+ <property name="right_attach">4</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">expand</property>
@@ -2761,34 +2918,44 @@ Album</property>
</child>
<child>
- <widget class="GtkColorButton" id="color_text">
+ <widget class="GtkLabel" id="label61">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="use_alpha">False</property>
- <property name="focus_on_click">True</property>
- <signal name="color_set" handler="on_color_text_color_set" last_modification_time="Wed, 10 Mar 2010 21:17:23 GMT"/>
+ <property name="label" translatable="yes">Selected text</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="left_attach">4</property>
+ <property name="right_attach">5</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
<property name="x_options">expand</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkColorButton" id="color_selected_text">
+ <widget class="GtkColorButton" id="listview_selected_text">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="use_alpha">False</property>
<property name="focus_on_click">True</property>
- <signal name="color_set" handler="on_color_selected_text_color_set" last_modification_time="Wed, 10 Mar 2010 21:17:26 GMT"/>
+ <signal name="color_set" handler="on_listview_selected_text_color_set" last_modification_time="Sat, 03 Apr 2010 18:03:29 GMT"/>
</widget>
<packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
+ <property name="left_attach">4</property>
+ <property name="right_attach">5</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">expand</property>
@@ -2797,15 +2964,44 @@ Album</property>
</child>
<child>
- <widget class="GtkColorButton" id="color_cursor">
+ <widget class="GtkLabel" id="label62">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Cursor</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">5</property>
+ <property name="right_attach">6</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">expand</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkColorButton" id="listview_cursor">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="use_alpha">False</property>
<property name="focus_on_click">True</property>
+ <signal name="color_set" handler="on_listview_cursor_color_set" last_modification_time="Sat, 03 Apr 2010 18:03:33 GMT"/>
</widget>
<packing>
- <property name="left_attach">4</property>
- <property name="right_attach">5</property>
+ <property name="left_attach">5</property>
+ <property name="right_attach">6</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">expand</property>
@@ -2813,31 +3009,45 @@ Album</property>
</packing>
</child>
</widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
</child>
</widget>
+ <packing>
+ <property name="tab_expand">False</property>
+ <property name="tab_fill">True</property>
+ </packing>
</child>
<child>
- <widget class="GtkCheckButton" id="disable_playlist_theming">
+ <widget class="GtkLabel" id="label75">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Disable playlist theming (speeds up rendering)</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_disable_playlist_theming_toggled" last_modification_time="Wed, 10 Mar 2010 21:17:33 GMT"/>
+ <property name="label" translatable="yes">Playlist colors</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
</widget>
<packing>
- <property name="type">label_item</property>
+ <property name="type">tab</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
diff --git a/plugins/gtkui/drawing.h b/plugins/gtkui/drawing.h
index deed2b2d..16f2c211 100644
--- a/plugins/gtkui/drawing.h
+++ b/plugins/gtkui/drawing.h
@@ -68,34 +68,53 @@ draw_text_with_colors (float x, float y, int width, int align, const char *text)
void
draw_get_text_extents (const char *text, int len, int *w, int *h);
+
+GdkColor *
+gtkui_get_bar_foreground_color (void);
+
+GdkColor *
+gtkui_get_bar_background_color (void);
+
GdkColor *
-gtkui_get_back_color (void);
+gtkui_get_tabstrip_dark_color (void);
GdkColor *
-gtkui_get_selection_color (void);
+gtkui_get_tabstrip_mid_color (void);
GdkColor *
-gtkui_get_dark_color (void);
+gtkui_get_tabstrip_light_color (void);
GdkColor *
-gtkui_get_mid_color (void);
+gtkui_get_tabstrip_base_color (void);
GdkColor *
-gtkui_get_light_color (void);
+gtkui_get_listview_even_row_color (void);
GdkColor *
-gtkui_get_even_row_color (void);
+gtkui_get_listview_odd_row_color (void);
GdkColor *
-gtkui_get_odd_row_color (void);
+gtkui_get_listview_selection_color (void);
GdkColor *
-gtkui_get_text_color (void);
+gtkui_get_listview_text_color (void);
GdkColor *
-gtkui_get_selected_text_color (void);
+gtkui_get_listview_selected_text_color (void);
+
+GdkColor *
+gtkui_get_listview_cursor_color (void);
void
gtkui_init_theme_colors (void);
+int
+gtkui_override_listview_colors (void);
+
+int
+gtkui_override_bar_colors (void);
+
+int
+gtkui_override_tabstrip_colors (void);
+
#endif // __DRAWING_H
diff --git a/plugins/gtkui/gdkdrawing.c b/plugins/gtkui/gdkdrawing.c
index 207575ea..84b07d29 100644
--- a/plugins/gtkui/gdkdrawing.c
+++ b/plugins/gtkui/gdkdrawing.c
@@ -149,116 +149,181 @@ draw_get_text_extents (const char *text, int len, int *w, int *h) {
*h = ink.height;
}
-static GdkColor gtkui_back_color;
-static GdkColor gtkui_selection_color;
-static GdkColor gtkui_dark_color;
-static GdkColor gtkui_mid_color;
-static GdkColor gtkui_light_color;
-static GdkColor gtkui_even_row_color;
-static GdkColor gtkui_odd_row_color;
-static GdkColor gtkui_text_color;
-static GdkColor gtkui_selected_text_color;
+static GdkColor gtkui_bar_foreground_color;
+static GdkColor gtkui_bar_background_color;
+
+static GdkColor gtkui_tabstrip_dark_color;
+static GdkColor gtkui_tabstrip_mid_color;
+static GdkColor gtkui_tabstrip_light_color;
+static GdkColor gtkui_tabstrip_base_color;
+
+static GdkColor gtkui_listview_even_row_color;
+static GdkColor gtkui_listview_odd_row_color;
+static GdkColor gtkui_listview_selection_color;
+static GdkColor gtkui_listview_text_color;
+static GdkColor gtkui_listview_selected_text_color;
+static GdkColor gtkui_listview_cursor_color;
+
+static int override_listview_colors = 0;
+static int override_bar_colors = 0;
+static int override_tabstrip_colors = 0;
+
+int
+gtkui_override_listview_colors (void) {
+ return override_listview_colors;
+}
+
+int
+gtkui_override_bar_colors (void) {
+ return override_bar_colors;
+}
+
+int
+gtkui_override_tabstrip_colors (void) {
+ return override_tabstrip_colors;
+}
void
gtkui_init_theme_colors (void) {
- int override = deadbeef->conf_get_int ("gtkui.override_theme_colors", 0);
+ override_listview_colors= deadbeef->conf_get_int ("gtkui.override_listview_colors", 0);
+ override_bar_colors = deadbeef->conf_get_int ("gtkui.override_bar_colors", 0);
+ override_tabstrip_colors = deadbeef->conf_get_int ("gtkui.override_tabstrip_colors", 0);
extern GtkWidget *mainwin;
GtkStyle *style = mainwin->style;
char color_text[100];
const char *clr;
- if (!override) {
- memcpy (&gtkui_selection_color, &style->base[GTK_STATE_SELECTED], sizeof (GdkColor));
- memcpy (&gtkui_back_color, &style->fg[GTK_STATE_NORMAL], sizeof (GdkColor));
- memcpy (&gtkui_dark_color, &style->dark[GTK_STATE_NORMAL], sizeof (GdkColor));
- memcpy (&gtkui_mid_color, &style->mid[GTK_STATE_NORMAL], sizeof (GdkColor));
- memcpy (&gtkui_light_color, &style->light[GTK_STATE_NORMAL], sizeof (GdkColor));
- memcpy (&gtkui_even_row_color, &style->light[GTK_STATE_NORMAL], sizeof (GdkColor));
- memcpy (&gtkui_odd_row_color, &style->mid[GTK_STATE_NORMAL], sizeof (GdkColor));
- memcpy (&gtkui_text_color, &style->fg[GTK_STATE_NORMAL], sizeof (GdkColor));
- memcpy (&gtkui_selected_text_color, &style->fg[GTK_STATE_SELECTED], sizeof (GdkColor));
+ if (!override_bar_colors) {
+ memcpy (&gtkui_bar_foreground_color, &style->base[GTK_STATE_SELECTED], sizeof (GdkColor));
+ memcpy (&gtkui_bar_background_color, &style->fg[GTK_STATE_NORMAL], sizeof (GdkColor));
}
else {
snprintf (color_text, sizeof (color_text), "%d %d %d", style->base[GTK_STATE_SELECTED].red, style->base[GTK_STATE_SELECTED].green, style->base[GTK_STATE_SELECTED].blue);
- clr = deadbeef->conf_get_str ("gtkui.color.selection", color_text);
- sscanf (clr, "%d %d %d", &gtkui_selection_color.red, &gtkui_selection_color.green, &gtkui_selection_color.blue);
+ clr = deadbeef->conf_get_str ("gtkui.color.bar_foreground", color_text);
+ sscanf (clr, "%d %d %d", &gtkui_bar_foreground_color.red, &gtkui_bar_foreground_color.green, &gtkui_bar_foreground_color.blue);
snprintf (color_text, sizeof (color_text), "%d %d %d", style->fg[GTK_STATE_NORMAL].red, style->fg[GTK_STATE_NORMAL].green, style->fg[GTK_STATE_NORMAL].blue);
- clr = deadbeef->conf_get_str ("gtkui.color.back", color_text);
- sscanf (clr, "%d %d %d", &gtkui_back_color.red, &gtkui_back_color.green, &gtkui_back_color.blue);
+ clr = deadbeef->conf_get_str ("gtkui.color.bar_background", color_text);
+ sscanf (clr, "%d %d %d", &gtkui_bar_background_color.red, &gtkui_bar_background_color.green, &gtkui_bar_background_color.blue);
+
+ }
+ if (!override_tabstrip_colors) {
+ memcpy (&gtkui_tabstrip_dark_color, &style->dark[GTK_STATE_NORMAL], sizeof (GdkColor));
+ memcpy (&gtkui_tabstrip_mid_color, &style->mid[GTK_STATE_NORMAL], sizeof (GdkColor));
+ memcpy (&gtkui_tabstrip_light_color, &style->light[GTK_STATE_NORMAL], sizeof (GdkColor));
+ memcpy (&gtkui_tabstrip_base_color, &style->bg[GTK_STATE_NORMAL], sizeof (GdkColor));
+ }
+ else {
snprintf (color_text, sizeof (color_text), "%d %d %d", style->dark[GTK_STATE_NORMAL].red, style->dark[GTK_STATE_NORMAL].green, style->dark[GTK_STATE_NORMAL].blue);
- clr = deadbeef->conf_get_str ("gtkui.color.dark", color_text);
- sscanf (clr, "%d %d %d", &gtkui_dark_color.red, &gtkui_dark_color.green, &gtkui_dark_color.blue);
+ clr = deadbeef->conf_get_str ("gtkui.color.tabstrip_dark", color_text);
+ sscanf (clr, "%d %d %d", &gtkui_tabstrip_dark_color.red, &gtkui_tabstrip_dark_color.green, &gtkui_tabstrip_dark_color.blue);
snprintf (color_text, sizeof (color_text), "%d %d %d", style->mid[GTK_STATE_NORMAL].red, style->mid[GTK_STATE_NORMAL].green, style->mid[GTK_STATE_NORMAL].blue);
- clr = deadbeef->conf_get_str ("gtkui.color.mid", color_text);
- sscanf (clr, "%d %d %d", &gtkui_mid_color.red, &gtkui_mid_color.green, &gtkui_mid_color.blue);
+ clr = deadbeef->conf_get_str ("gtkui.color.tabstrip_mid", color_text);
+ sscanf (clr, "%d %d %d", &gtkui_tabstrip_mid_color.red, &gtkui_tabstrip_mid_color.green, &gtkui_tabstrip_mid_color.blue);
snprintf (color_text, sizeof (color_text), "%d %d %d", style->light[GTK_STATE_NORMAL].red, style->light[GTK_STATE_NORMAL].green, style->light[GTK_STATE_NORMAL].blue);
- clr = deadbeef->conf_get_str ("gtkui.color.light", color_text);
- sscanf (clr, "%d %d %d", &gtkui_light_color.red, &gtkui_light_color.green, &gtkui_light_color.blue);
+ clr = deadbeef->conf_get_str ("gtkui.color.tabstrip_light", color_text);
+ sscanf (clr, "%d %d %d", &gtkui_tabstrip_light_color.red, &gtkui_tabstrip_light_color.green, &gtkui_tabstrip_light_color.blue);
+
+ snprintf (color_text, sizeof (color_text), "%d %d %d", style->bg[GTK_STATE_NORMAL].red, style->bg[GTK_STATE_NORMAL].green, style->bg[GTK_STATE_NORMAL].blue);
+ clr = deadbeef->conf_get_str ("gtkui.color.tabstrip_base", color_text);
+ sscanf (clr, "%d %d %d", &gtkui_tabstrip_base_color.red, &gtkui_tabstrip_base_color.green, &gtkui_tabstrip_base_color.blue);
+ }
+ if (!override_listview_colors) {
+ memcpy (&gtkui_listview_even_row_color, &style->light[GTK_STATE_NORMAL], sizeof (GdkColor));
+ memcpy (&gtkui_listview_odd_row_color, &style->mid[GTK_STATE_NORMAL], sizeof (GdkColor));
+ memcpy (&gtkui_listview_selection_color, &style->bg[GTK_STATE_SELECTED], sizeof (GdkColor));
+ memcpy (&gtkui_listview_text_color, &style->fg[GTK_STATE_NORMAL], sizeof (GdkColor));
+ memcpy (&gtkui_listview_selected_text_color, &style->fg[GTK_STATE_SELECTED], sizeof (GdkColor));
+ memcpy (&gtkui_listview_cursor_color, &style->fg[GTK_STATE_NORMAL], sizeof (GdkColor));
+ }
+ else {
snprintf (color_text, sizeof (color_text), "%d %d %d", style->light[GTK_STATE_NORMAL].red, style->light[GTK_STATE_NORMAL].green, style->light[GTK_STATE_NORMAL].blue);
- clr = deadbeef->conf_get_str ("gtkui.color.even_row", color_text);
- sscanf (clr, "%d %d %d", &gtkui_even_row_color.red, &gtkui_even_row_color.green, &gtkui_even_row_color.blue);
+ clr = deadbeef->conf_get_str ("gtkui.color.listview_even_row", color_text);
+ sscanf (clr, "%d %d %d", &gtkui_listview_even_row_color.red, &gtkui_listview_even_row_color.green, &gtkui_listview_even_row_color.blue);
snprintf (color_text, sizeof (color_text), "%d %d %d", style->mid[GTK_STATE_NORMAL].red, style->mid[GTK_STATE_NORMAL].green, style->mid[GTK_STATE_NORMAL].blue);
- clr = deadbeef->conf_get_str ("gtkui.color.odd_row", color_text);
- sscanf (clr, "%d %d %d", &gtkui_odd_row_color.red, &gtkui_odd_row_color.green, &gtkui_odd_row_color.blue);
+ clr = deadbeef->conf_get_str ("gtkui.color.listview_odd_row", color_text);
+ sscanf (clr, "%d %d %d", &gtkui_listview_odd_row_color.red, &gtkui_listview_odd_row_color.green, &gtkui_listview_odd_row_color.blue);
+
+ snprintf (color_text, sizeof (color_text), "%d %d %d", style->mid[GTK_STATE_NORMAL].red, style->mid[GTK_STATE_NORMAL].green, style->mid[GTK_STATE_NORMAL].blue);
+ clr = deadbeef->conf_get_str ("gtkui.color.listview_selection", color_text);
+ sscanf (clr, "%d %d %d", &gtkui_listview_selection_color.red, &gtkui_listview_selection_color.green, &gtkui_listview_selection_color.blue);
snprintf (color_text, sizeof (color_text), "%d %d %d", style->fg[GTK_STATE_NORMAL].red, style->fg[GTK_STATE_NORMAL].green, style->fg[GTK_STATE_NORMAL].blue);
- clr = deadbeef->conf_get_str ("gtkui.color.text", color_text);
- sscanf (clr, "%d %d %d", &gtkui_text_color.red, &gtkui_text_color.green, &gtkui_text_color.blue);
+ clr = deadbeef->conf_get_str ("gtkui.color.listview_text", color_text);
+ sscanf (clr, "%d %d %d", &gtkui_listview_text_color.red, &gtkui_listview_text_color.green, &gtkui_listview_text_color.blue);
+
+ snprintf (color_text, sizeof (color_text), "%d %d %d", style->fg[GTK_STATE_SELECTED].red, style->fg[GTK_STATE_SELECTED].green, style->fg[GTK_STATE_SELECTED].blue);
+ clr = deadbeef->conf_get_str ("gtkui.color.listview_selected_text", color_text);
+ sscanf (clr, "%d %d %d", &gtkui_listview_selected_text_color.red, &gtkui_listview_selected_text_color.green, &gtkui_listview_selected_text_color.blue);
snprintf (color_text, sizeof (color_text), "%d %d %d", style->fg[GTK_STATE_SELECTED].red, style->fg[GTK_STATE_SELECTED].green, style->fg[GTK_STATE_SELECTED].blue);
- clr = deadbeef->conf_get_str ("gtkui.color.selected_text", color_text);
- sscanf (clr, "%d %d %d", &gtkui_selected_text_color.red, &gtkui_selected_text_color.green, &gtkui_selected_text_color.blue);
+ clr = deadbeef->conf_get_str ("gtkui.color.listview_cursor", color_text);
+ sscanf (clr, "%d %d %d", &gtkui_listview_cursor_color.red, &gtkui_listview_cursor_color.green, &gtkui_listview_cursor_color.blue);
}
}
GdkColor *
-gtkui_get_back_color (void) {
- return &gtkui_back_color;
+gtkui_get_bar_foreground_color (void) {
+ return &gtkui_bar_foreground_color;
+}
+
+GdkColor *
+gtkui_get_bar_background_color (void) {
+ return &gtkui_bar_background_color;
+}
+
+GdkColor *
+gtkui_get_tabstrip_dark_color (void) {
+ return &gtkui_tabstrip_dark_color;
+}
+
+GdkColor *
+gtkui_get_tabstrip_mid_color (void) {
+ return &gtkui_tabstrip_mid_color;
}
GdkColor *
-gtkui_get_selection_color (void) {
- return &gtkui_selection_color;
+gtkui_get_tabstrip_light_color (void) {
+ return &gtkui_tabstrip_light_color;
}
GdkColor *
-gtkui_get_dark_color (void) {
- return &gtkui_dark_color;
+gtkui_get_tabstrip_base_color (void) {
+ return &gtkui_tabstrip_base_color;
}
GdkColor *
-gtkui_get_mid_color (void) {
- return &gtkui_mid_color;
+gtkui_get_listview_even_row_color (void) {
+ return &gtkui_listview_even_row_color;
}
GdkColor *
-gtkui_get_light_color (void) {
- return &gtkui_light_color;
+gtkui_get_listview_odd_row_color (void) {
+ return &gtkui_listview_odd_row_color;
}
GdkColor *
-gtkui_get_even_row_color (void) {
- return &gtkui_even_row_color;
+gtkui_get_listview_selection_color (void) {
+ return &gtkui_listview_selection_color;
}
GdkColor *
-gtkui_get_odd_row_color (void) {
- return &gtkui_odd_row_color;
+gtkui_get_listview_text_color (void) {
+ return &gtkui_listview_text_color;
}
GdkColor *
-gtkui_get_text_color (void) {
- return &gtkui_text_color;
+gtkui_get_listview_selected_text_color (void) {
+ return &gtkui_listview_selected_text_color;
}
GdkColor *
-gtkui_get_selected_text_color (void) {
- return &gtkui_selected_text_color;
+gtkui_get_listview_cursor_color (void) {
+ return &gtkui_listview_cursor_color;
}
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index b72ab6ba..ab26084f 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -66,7 +66,6 @@ GtkWidget *traymenu;
// playlist theming
GtkWidget *theme_treeview;
GtkWidget *theme_button;
-int disable_listview_theming = 0;
// that must be called before gtk_init
void
@@ -233,8 +232,7 @@ on_trayicon_scroll_event (GtkWidget *widget,
vol = -60;
}
deadbeef->volume_set_db (vol);
- GtkWidget *volumebar = lookup_widget (mainwin, "volumebar");
- gdk_window_invalidate_rect (volumebar->window, NULL, FALSE);
+ volumebar_redraw ();
return FALSE;
}
@@ -501,18 +499,9 @@ gtkui_on_configchanged (DB_event_t *ev, uintptr_t data) {
int stop_after_current = deadbeef->conf_get_int ("playlist.stop_after_current", 0);
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "stop_after_current")), stop_after_current ? TRUE : FALSE);
- // theme colors
- gtkui_init_theme_colors ();
-
- disable_listview_theming = deadbeef->conf_get_int ("gtkui.disable_playlist_theming", 0);
return 0;
}
-int
-gtkui_listview_theming_disabled (void) {
- return disable_listview_theming;
-}
-
static gboolean
outputchanged_cb (gpointer nothing) {
preferences_fill_soundcards ();
@@ -667,11 +656,7 @@ update_win_title_idle (gpointer data) {
static gboolean
redraw_seekbar_cb (gpointer nothing) {
- void seekbar_draw (GtkWidget *widget);
- void seekbar_expose (GtkWidget *widget, int x, int y, int w, int h);
- GtkWidget *widget = lookup_widget (mainwin, "seekbar");
- seekbar_draw (widget);
- seekbar_expose (widget, 0, 0, widget->allocation.width, widget->allocation.height);
+ seekbar_redraw ();
return FALSE;
}
@@ -703,6 +688,18 @@ gtkui_add_new_playlist (void) {
return -1;
}
+void
+volumebar_redraw (void) {
+ GtkWidget *volumebar = lookup_widget (mainwin, "volumebar");
+ gdk_window_invalidate_rect (volumebar->window, NULL, FALSE);
+}
+
+void
+tabstrip_redraw (void) {
+ GtkWidget *ts = lookup_widget (mainwin, "tabstrip");
+ ddb_tabstrip_refresh (DDB_TABSTRIP (ts));
+}
+
static int gtk_initialized = 0;
void
@@ -763,6 +760,7 @@ gtkui_thread (void *ctx) {
}
gtkui_on_configchanged (NULL, 0);
+ gtkui_init_theme_colors ();
// visibility of statusbar and headers
GtkWidget *header_mi = lookup_widget (mainwin, "view_headers");
diff --git a/plugins/gtkui/gtkui.h b/plugins/gtkui/gtkui.h
index a128cb3a..ef8cf9a3 100644
--- a/plugins/gtkui/gtkui.h
+++ b/plugins/gtkui/gtkui.h
@@ -87,9 +87,15 @@ void
search_refresh (void);
int
-gtkui_listview_theming_disabled (void);
-
-int
gtkui_add_new_playlist (void);
+void
+seekbar_redraw (void);
+
+void
+volumebar_redraw (void);
+
+void
+tabstrip_redraw (void);
+
#endif
diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c
index 6f06eb46..2812289c 100644
--- a/plugins/gtkui/interface.c
+++ b/plugins/gtkui/interface.c
@@ -1393,34 +1393,43 @@ create_prefwin (void)
GtkWidget *vbox9;
GtkWidget *pref_close_send_to_tray;
GtkWidget *mmb_delete_playlist;
- GtkWidget *frame3;
- GtkWidget *alignment1;
- GtkWidget *colors_table;
- GtkWidget *color_light;
- GtkWidget *color_mid;
- GtkWidget *color_dark;
- GtkWidget *color_selection;
+ GtkWidget *notebook4;
+ GtkWidget *vbox21;
+ GtkWidget *override_bar_colors;
+ GtkWidget *bar_colors_group;
GtkWidget *label43;
- GtkWidget *label44;
+ GtkWidget *label47;
+ GtkWidget *bar_foreground;
+ GtkWidget *bar_background;
+ GtkWidget *label73;
+ GtkWidget *vbox22;
+ GtkWidget *override_tabstrip_colors;
+ GtkWidget *tabstrip_colors_group;
GtkWidget *label45;
GtkWidget *label46;
- GtkWidget *color_back;
- GtkWidget *label47;
- GtkWidget *override_theme_colors;
- GtkWidget *frame4;
- GtkWidget *alignment2;
- GtkWidget *listview_colors_table;
+ GtkWidget *label44;
+ GtkWidget *tabstrip_mid;
+ GtkWidget *tabstrip_light;
+ GtkWidget *tabstrip_dark;
+ GtkWidget *tabstrip_base;
+ GtkWidget *label76;
+ GtkWidget *label74;
+ GtkWidget *vbox23;
+ GtkWidget *override_listview_colors;
+ GtkWidget *listview_colors_group;
GtkWidget *label58;
GtkWidget *label59;
- GtkWidget *label60;
+ GtkWidget *listview_even_row;
+ GtkWidget *listview_odd_row;
+ GtkWidget *label77;
+ GtkWidget *label78;
+ GtkWidget *listview_selected_row;
+ GtkWidget *listview_text;
GtkWidget *label61;
+ GtkWidget *listview_selected_text;
GtkWidget *label62;
- GtkWidget *color_even_row;
- GtkWidget *color_odd_row;
- GtkWidget *color_text;
- GtkWidget *color_selected_text;
- GtkWidget *color_cursor;
- GtkWidget *disable_playlist_theming;
+ GtkWidget *listview_cursor;
+ GtkWidget *label75;
GtkWidget *label2;
GtkWidget *vbox11;
GtkWidget *pref_network_enableproxy;
@@ -1609,175 +1618,219 @@ create_prefwin (void)
gtk_widget_show (mmb_delete_playlist);
gtk_box_pack_start (GTK_BOX (vbox9), mmb_delete_playlist, FALSE, FALSE, 0);
- frame3 = gtk_frame_new (NULL);
- gtk_widget_show (frame3);
- gtk_box_pack_start (GTK_BOX (vbox9), frame3, FALSE, TRUE, 0);
- gtk_frame_set_shadow_type (GTK_FRAME (frame3), GTK_SHADOW_IN);
-
- alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1);
- gtk_widget_show (alignment1);
- gtk_container_add (GTK_CONTAINER (frame3), alignment1);
- gtk_alignment_set_padding (GTK_ALIGNMENT (alignment1), 0, 0, 12, 0);
-
- colors_table = gtk_table_new (2, 5, TRUE);
- gtk_widget_show (colors_table);
- gtk_container_add (GTK_CONTAINER (alignment1), colors_table);
- gtk_container_set_border_width (GTK_CONTAINER (colors_table), 12);
- gtk_table_set_col_spacings (GTK_TABLE (colors_table), 8);
-
- color_light = gtk_color_button_new ();
- gtk_widget_show (color_light);
- gtk_table_attach (GTK_TABLE (colors_table), color_light, 3, 4, 1, 2,
+ notebook4 = gtk_notebook_new ();
+ gtk_widget_show (notebook4);
+ gtk_box_pack_start (GTK_BOX (vbox9), notebook4, TRUE, TRUE, 0);
+
+ vbox21 = gtk_vbox_new (FALSE, 8);
+ gtk_widget_show (vbox21);
+ gtk_container_add (GTK_CONTAINER (notebook4), vbox21);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox21), 12);
+
+ override_bar_colors = gtk_check_button_new_with_mnemonic ("Override");
+ gtk_widget_show (override_bar_colors);
+ gtk_box_pack_start (GTK_BOX (vbox21), override_bar_colors, FALSE, FALSE, 0);
+
+ bar_colors_group = gtk_table_new (2, 2, TRUE);
+ gtk_widget_show (bar_colors_group);
+ gtk_box_pack_start (GTK_BOX (vbox21), bar_colors_group, TRUE, TRUE, 0);
+ gtk_table_set_col_spacings (GTK_TABLE (bar_colors_group), 8);
+
+ label43 = gtk_label_new ("Foreground");
+ gtk_widget_show (label43);
+ gtk_table_attach (GTK_TABLE (bar_colors_group), label43, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label43), 0, 0.5);
- color_mid = gtk_color_button_new ();
- gtk_widget_show (color_mid);
- gtk_table_attach (GTK_TABLE (colors_table), color_mid, 2, 3, 1, 2,
+ label47 = gtk_label_new ("Background");
+ gtk_widget_show (label47);
+ gtk_table_attach (GTK_TABLE (bar_colors_group), label47, 1, 2, 0, 1,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label47), 0, 0.5);
- color_dark = gtk_color_button_new ();
- gtk_widget_show (color_dark);
- gtk_table_attach (GTK_TABLE (colors_table), color_dark, 1, 2, 1, 2,
+ bar_foreground = gtk_color_button_new ();
+ gtk_widget_show (bar_foreground);
+ gtk_table_attach (GTK_TABLE (bar_colors_group), bar_foreground, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
- color_selection = gtk_color_button_new ();
- gtk_widget_show (color_selection);
- gtk_table_attach (GTK_TABLE (colors_table), color_selection, 0, 1, 1, 2,
+ bar_background = gtk_color_button_new ();
+ gtk_widget_show (bar_background);
+ gtk_table_attach (GTK_TABLE (bar_colors_group), bar_background, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
- label43 = gtk_label_new ("Selection");
- gtk_widget_show (label43);
- gtk_table_attach (GTK_TABLE (colors_table), label43, 0, 1, 0, 1,
+ label73 = gtk_label_new ("Seekbar/Volumebar colors");
+ gtk_widget_show (label73);
+ gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook4), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook4), 0), label73);
+
+ vbox22 = gtk_vbox_new (FALSE, 8);
+ gtk_widget_show (vbox22);
+ gtk_container_add (GTK_CONTAINER (notebook4), vbox22);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox22), 12);
+
+ override_tabstrip_colors = gtk_check_button_new_with_mnemonic ("Override");
+ gtk_widget_show (override_tabstrip_colors);
+ gtk_box_pack_start (GTK_BOX (vbox22), override_tabstrip_colors, FALSE, FALSE, 0);
+
+ tabstrip_colors_group = gtk_table_new (2, 4, TRUE);
+ gtk_widget_show (tabstrip_colors_group);
+ gtk_box_pack_start (GTK_BOX (vbox22), tabstrip_colors_group, TRUE, TRUE, 0);
+ gtk_table_set_col_spacings (GTK_TABLE (tabstrip_colors_group), 8);
+
+ label45 = gtk_label_new ("Middle");
+ gtk_widget_show (label45);
+ gtk_table_attach (GTK_TABLE (tabstrip_colors_group), label45, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label43), 0, 0.5);
+ gtk_misc_set_alignment (GTK_MISC (label45), 0, 0.5);
+
+ label46 = gtk_label_new ("Light");
+ gtk_widget_show (label46);
+ gtk_table_attach (GTK_TABLE (tabstrip_colors_group), label46, 1, 2, 0, 1,
+ (GtkAttachOptions) (GTK_EXPAND),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label46), 0, 0.5);
label44 = gtk_label_new ("Dark");
gtk_widget_show (label44);
- gtk_table_attach (GTK_TABLE (colors_table), label44, 1, 2, 0, 1,
+ gtk_table_attach (GTK_TABLE (tabstrip_colors_group), label44, 2, 3, 0, 1,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label44), 0, 0.5);
- label45 = gtk_label_new ("Middle");
- gtk_widget_show (label45);
- gtk_table_attach (GTK_TABLE (colors_table), label45, 2, 3, 0, 1,
+ tabstrip_mid = gtk_color_button_new ();
+ gtk_widget_show (tabstrip_mid);
+ gtk_table_attach (GTK_TABLE (tabstrip_colors_group), tabstrip_mid, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label45), 0, 0.5);
- label46 = gtk_label_new ("Light");
- gtk_widget_show (label46);
- gtk_table_attach (GTK_TABLE (colors_table), label46, 3, 4, 0, 1,
+ tabstrip_light = gtk_color_button_new ();
+ gtk_widget_show (tabstrip_light);
+ gtk_table_attach (GTK_TABLE (tabstrip_colors_group), tabstrip_light, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label46), 0, 0.5);
- color_back = gtk_color_button_new ();
- gtk_widget_show (color_back);
- gtk_table_attach (GTK_TABLE (colors_table), color_back, 4, 5, 1, 2,
+ tabstrip_dark = gtk_color_button_new ();
+ gtk_widget_show (tabstrip_dark);
+ gtk_table_attach (GTK_TABLE (tabstrip_colors_group), tabstrip_dark, 2, 3, 1, 2,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
- label47 = gtk_label_new ("Inactive background");
- gtk_widget_show (label47);
- gtk_table_attach (GTK_TABLE (colors_table), label47, 4, 5, 0, 1,
+ tabstrip_base = gtk_color_button_new ();
+ gtk_widget_show (tabstrip_base);
+ gtk_table_attach (GTK_TABLE (tabstrip_colors_group), tabstrip_base, 3, 4, 1, 2,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label47), 0, 0.5);
- override_theme_colors = gtk_check_button_new_with_mnemonic ("Override GTK+ theme colors in volume control and seek bar widgets");
- gtk_widget_show (override_theme_colors);
- gtk_frame_set_label_widget (GTK_FRAME (frame3), override_theme_colors);
+ label76 = gtk_label_new ("Base");
+ gtk_widget_show (label76);
+ gtk_table_attach (GTK_TABLE (tabstrip_colors_group), label76, 3, 4, 0, 1,
+ (GtkAttachOptions) (GTK_EXPAND),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label76), 0, 0.5);
+
+ label74 = gtk_label_new ("Tabstrip colors");
+ gtk_widget_show (label74);
+ gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook4), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook4), 1), label74);
- frame4 = gtk_frame_new (NULL);
- gtk_widget_show (frame4);
- gtk_box_pack_start (GTK_BOX (vbox9), frame4, FALSE, TRUE, 0);
- gtk_frame_set_shadow_type (GTK_FRAME (frame4), GTK_SHADOW_IN);
+ vbox23 = gtk_vbox_new (FALSE, 8);
+ gtk_widget_show (vbox23);
+ gtk_container_add (GTK_CONTAINER (notebook4), vbox23);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox23), 12);
- alignment2 = gtk_alignment_new (0.5, 0.5, 1, 1);
- gtk_widget_show (alignment2);
- gtk_container_add (GTK_CONTAINER (frame4), alignment2);
- gtk_alignment_set_padding (GTK_ALIGNMENT (alignment2), 0, 0, 12, 0);
+ override_listview_colors = gtk_check_button_new_with_mnemonic ("Override (looses GTK treeview theming, but speeds up rendering)");
+ gtk_widget_show (override_listview_colors);
+ gtk_box_pack_start (GTK_BOX (vbox23), override_listview_colors, FALSE, FALSE, 0);
- listview_colors_table = gtk_table_new (2, 5, TRUE);
- gtk_widget_show (listview_colors_table);
- gtk_container_add (GTK_CONTAINER (alignment2), listview_colors_table);
- gtk_container_set_border_width (GTK_CONTAINER (listview_colors_table), 12);
- gtk_table_set_col_spacings (GTK_TABLE (listview_colors_table), 8);
+ listview_colors_group = gtk_table_new (2, 6, TRUE);
+ gtk_widget_show (listview_colors_group);
+ gtk_box_pack_start (GTK_BOX (vbox23), listview_colors_group, TRUE, TRUE, 0);
+ gtk_table_set_col_spacings (GTK_TABLE (listview_colors_group), 8);
label58 = gtk_label_new ("Even row");
gtk_widget_show (label58);
- gtk_table_attach (GTK_TABLE (listview_colors_table), label58, 0, 1, 0, 1,
+ gtk_table_attach (GTK_TABLE (listview_colors_group), label58, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label58), 0, 0.5);
label59 = gtk_label_new ("Odd row");
gtk_widget_show (label59);
- gtk_table_attach (GTK_TABLE (listview_colors_table), label59, 1, 2, 0, 1,
+ gtk_table_attach (GTK_TABLE (listview_colors_group), label59, 1, 2, 0, 1,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label59), 0, 0.5);
- label60 = gtk_label_new ("Text");
- gtk_widget_show (label60);
- gtk_table_attach (GTK_TABLE (listview_colors_table), label60, 2, 3, 0, 1,
+ listview_even_row = gtk_color_button_new ();
+ gtk_widget_show (listview_even_row);
+ gtk_table_attach (GTK_TABLE (listview_colors_group), listview_even_row, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label60), 0, 0.5);
- label61 = gtk_label_new ("Selected text");
- gtk_widget_show (label61);
- gtk_table_attach (GTK_TABLE (listview_colors_table), label61, 3, 4, 0, 1,
+ listview_odd_row = gtk_color_button_new ();
+ gtk_widget_show (listview_odd_row);
+ gtk_table_attach (GTK_TABLE (listview_colors_group), listview_odd_row, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label61), 0, 0.5);
- label62 = gtk_label_new ("Cursor");
- gtk_widget_show (label62);
- gtk_table_attach (GTK_TABLE (listview_colors_table), label62, 4, 5, 0, 1,
+ label77 = gtk_label_new ("Text");
+ gtk_widget_show (label77);
+ gtk_table_attach (GTK_TABLE (listview_colors_group), label77, 3, 4, 0, 1,
+ (GtkAttachOptions) (GTK_EXPAND),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label77), 0, 0.5);
+
+ label78 = gtk_label_new ("Selected row");
+ gtk_widget_show (label78);
+ gtk_table_attach (GTK_TABLE (listview_colors_group), label78, 2, 3, 0, 1,
+ (GtkAttachOptions) (GTK_EXPAND),
+ (GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label78), 0, 0.5);
+
+ listview_selected_row = gtk_color_button_new ();
+ gtk_widget_show (listview_selected_row);
+ gtk_table_attach (GTK_TABLE (listview_colors_group), listview_selected_row, 2, 3, 1, 2,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
- gtk_misc_set_alignment (GTK_MISC (label62), 0, 0.5);
- color_even_row = gtk_color_button_new ();
- gtk_widget_show (color_even_row);
- gtk_table_attach (GTK_TABLE (listview_colors_table), color_even_row, 0, 1, 1, 2,
+ listview_text = gtk_color_button_new ();
+ gtk_widget_show (listview_text);
+ gtk_table_attach (GTK_TABLE (listview_colors_group), listview_text, 3, 4, 1, 2,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
- color_odd_row = gtk_color_button_new ();
- gtk_widget_show (color_odd_row);
- gtk_table_attach (GTK_TABLE (listview_colors_table), color_odd_row, 1, 2, 1, 2,
+ label61 = gtk_label_new ("Selected text");
+ gtk_widget_show (label61);
+ gtk_table_attach (GTK_TABLE (listview_colors_group), label61, 4, 5, 0, 1,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label61), 0, 0.5);
- color_text = gtk_color_button_new ();
- gtk_widget_show (color_text);
- gtk_table_attach (GTK_TABLE (listview_colors_table), color_text, 2, 3, 1, 2,
+ listview_selected_text = gtk_color_button_new ();
+ gtk_widget_show (listview_selected_text);
+ gtk_table_attach (GTK_TABLE (listview_colors_group), listview_selected_text, 4, 5, 1, 2,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
- color_selected_text = gtk_color_button_new ();
- gtk_widget_show (color_selected_text);
- gtk_table_attach (GTK_TABLE (listview_colors_table), color_selected_text, 3, 4, 1, 2,
+ label62 = gtk_label_new ("Cursor");
+ gtk_widget_show (label62);
+ gtk_table_attach (GTK_TABLE (listview_colors_group), label62, 5, 6, 0, 1,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
+ gtk_misc_set_alignment (GTK_MISC (label62), 0, 0.5);
- color_cursor = gtk_color_button_new ();
- gtk_widget_show (color_cursor);
- gtk_table_attach (GTK_TABLE (listview_colors_table), color_cursor, 4, 5, 1, 2,
+ listview_cursor = gtk_color_button_new ();
+ gtk_widget_show (listview_cursor);
+ gtk_table_attach (GTK_TABLE (listview_colors_group), listview_cursor, 5, 6, 1, 2,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
- disable_playlist_theming = gtk_check_button_new_with_mnemonic ("Disable playlist theming (speeds up rendering)");
- gtk_widget_show (disable_playlist_theming);
- gtk_frame_set_label_widget (GTK_FRAME (frame4), disable_playlist_theming);
+ label75 = gtk_label_new ("Playlist colors");
+ gtk_widget_show (label75);
+ gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook4), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook4), 2), label75);
label2 = gtk_label_new ("GUI");
gtk_widget_show (label2);
@@ -2138,38 +2191,50 @@ create_prefwin (void)
g_signal_connect ((gpointer) mmb_delete_playlist, "toggled",
G_CALLBACK (on_mmb_delete_playlist_toggled),
NULL);
- g_signal_connect ((gpointer) color_light, "color_set",
- G_CALLBACK (on_color_light_color_set),
+ g_signal_connect ((gpointer) override_bar_colors, "toggled",
+ G_CALLBACK (on_override_bar_colors_toggled),
NULL);
- g_signal_connect ((gpointer) color_mid, "color_set",
- G_CALLBACK (on_color_mid_color_set),
+ g_signal_connect ((gpointer) bar_foreground, "color_set",
+ G_CALLBACK (on_bar_foreground_color_set),
NULL);
- g_signal_connect ((gpointer) color_dark, "color_set",
- G_CALLBACK (on_color_dark_color_set),
+ g_signal_connect ((gpointer) bar_background, "color_set",
+ G_CALLBACK (on_bar_background_color_set),
NULL);
- g_signal_connect ((gpointer) color_selection, "color_set",
- G_CALLBACK (on_color_selection_color_set),
+ g_signal_connect ((gpointer) override_tabstrip_colors, "toggled",
+ G_CALLBACK (on_override_tabstrip_colors_toggled),
NULL);
- g_signal_connect ((gpointer) color_back, "color_set",
- G_CALLBACK (on_color_back_color_set),
+ g_signal_connect ((gpointer) tabstrip_mid, "color_set",
+ G_CALLBACK (on_tabstrip_mid_color_set),
NULL);
- g_signal_connect ((gpointer) override_theme_colors, "toggled",
- G_CALLBACK (on_override_gtk_colors_toggled),
+ g_signal_connect ((gpointer) tabstrip_light, "color_set",
+ G_CALLBACK (on_tabstrip_light_color_set),
NULL);
- g_signal_connect ((gpointer) color_even_row, "color_set",
- G_CALLBACK (on_color_even_row_color_set),
+ g_signal_connect ((gpointer) tabstrip_dark, "color_set",
+ G_CALLBACK (on_tabstrip_dark_color_set),
NULL);
- g_signal_connect ((gpointer) color_odd_row, "color_set",
- G_CALLBACK (on_color_odd_row_color_set),
+ g_signal_connect ((gpointer) tabstrip_base, "color_set",
+ G_CALLBACK (on_tabstrip_base_color_set),
NULL);
- g_signal_connect ((gpointer) color_text, "color_set",
- G_CALLBACK (on_color_text_color_set),
+ g_signal_connect ((gpointer) override_listview_colors, "toggled",
+ G_CALLBACK (on_override_listview_colors_toggled),
NULL);
- g_signal_connect ((gpointer) color_selected_text, "color_set",
- G_CALLBACK (on_color_selected_text_color_set),
+ g_signal_connect ((gpointer) listview_even_row, "color_set",
+ G_CALLBACK (on_listview_even_row_color_set),
NULL);
- g_signal_connect ((gpointer) disable_playlist_theming, "toggled",
- G_CALLBACK (on_disable_playlist_theming_toggled),
+ g_signal_connect ((gpointer) listview_odd_row, "color_set",
+ G_CALLBACK (on_listview_odd_row_color_set),
+ NULL);
+ g_signal_connect ((gpointer) listview_selected_row, "color_set",
+ G_CALLBACK (on_listview_selected_row_color_set),
+ NULL);
+ g_signal_connect ((gpointer) listview_text, "color_set",
+ G_CALLBACK (on_listview_text_color_set),
+ NULL);
+ g_signal_connect ((gpointer) listview_selected_text, "color_set",
+ G_CALLBACK (on_listview_selected_text_color_set),
+ NULL);
+ g_signal_connect ((gpointer) listview_cursor, "color_set",
+ G_CALLBACK (on_listview_cursor_color_set),
NULL);
g_signal_connect ((gpointer) pref_network_enableproxy, "clicked",
G_CALLBACK (on_pref_network_enableproxy_clicked),
@@ -2251,34 +2316,43 @@ create_prefwin (void)
GLADE_HOOKUP_OBJECT (prefwin, vbox9, "vbox9");
GLADE_HOOKUP_OBJECT (prefwin, pref_close_send_to_tray, "pref_close_send_to_tray");
GLADE_HOOKUP_OBJECT (prefwin, mmb_delete_playlist, "mmb_delete_playlist");
- GLADE_HOOKUP_OBJECT (prefwin, frame3, "frame3");
- GLADE_HOOKUP_OBJECT (prefwin, alignment1, "alignment1");
- GLADE_HOOKUP_OBJECT (prefwin, colors_table, "colors_table");
- GLADE_HOOKUP_OBJECT (prefwin, color_light, "color_light");
- GLADE_HOOKUP_OBJECT (prefwin, color_mid, "color_mid");
- GLADE_HOOKUP_OBJECT (prefwin, color_dark, "color_dark");
- GLADE_HOOKUP_OBJECT (prefwin, color_selection, "color_selection");
+ GLADE_HOOKUP_OBJECT (prefwin, notebook4, "notebook4");
+ GLADE_HOOKUP_OBJECT (prefwin, vbox21, "vbox21");
+ GLADE_HOOKUP_OBJECT (prefwin, override_bar_colors, "override_bar_colors");
+ GLADE_HOOKUP_OBJECT (prefwin, bar_colors_group, "bar_colors_group");
GLADE_HOOKUP_OBJECT (prefwin, label43, "label43");
- GLADE_HOOKUP_OBJECT (prefwin, label44, "label44");
+ GLADE_HOOKUP_OBJECT (prefwin, label47, "label47");
+ GLADE_HOOKUP_OBJECT (prefwin, bar_foreground, "bar_foreground");
+ GLADE_HOOKUP_OBJECT (prefwin, bar_background, "bar_background");
+ GLADE_HOOKUP_OBJECT (prefwin, label73, "label73");
+ GLADE_HOOKUP_OBJECT (prefwin, vbox22, "vbox22");
+ GLADE_HOOKUP_OBJECT (prefwin, override_tabstrip_colors, "override_tabstrip_colors");
+ GLADE_HOOKUP_OBJECT (prefwin, tabstrip_colors_group, "tabstrip_colors_group");
GLADE_HOOKUP_OBJECT (prefwin, label45, "label45");
GLADE_HOOKUP_OBJECT (prefwin, label46, "label46");
- GLADE_HOOKUP_OBJECT (prefwin, color_back, "color_back");
- GLADE_HOOKUP_OBJECT (prefwin, label47, "label47");
- GLADE_HOOKUP_OBJECT (prefwin, override_theme_colors, "override_theme_colors");
- GLADE_HOOKUP_OBJECT (prefwin, frame4, "frame4");
- GLADE_HOOKUP_OBJECT (prefwin, alignment2, "alignment2");
- GLADE_HOOKUP_OBJECT (prefwin, listview_colors_table, "listview_colors_table");
+ GLADE_HOOKUP_OBJECT (prefwin, label44, "label44");
+ GLADE_HOOKUP_OBJECT (prefwin, tabstrip_mid, "tabstrip_mid");
+ GLADE_HOOKUP_OBJECT (prefwin, tabstrip_light, "tabstrip_light");
+ GLADE_HOOKUP_OBJECT (prefwin, tabstrip_dark, "tabstrip_dark");
+ GLADE_HOOKUP_OBJECT (prefwin, tabstrip_base, "tabstrip_base");
+ GLADE_HOOKUP_OBJECT (prefwin, label76, "label76");
+ GLADE_HOOKUP_OBJECT (prefwin, label74, "label74");
+ GLADE_HOOKUP_OBJECT (prefwin, vbox23, "vbox23");
+ GLADE_HOOKUP_OBJECT (prefwin, override_listview_colors, "override_listview_colors");
+ GLADE_HOOKUP_OBJECT (prefwin, listview_colors_group, "listview_colors_group");
GLADE_HOOKUP_OBJECT (prefwin, label58, "label58");
GLADE_HOOKUP_OBJECT (prefwin, label59, "label59");
- GLADE_HOOKUP_OBJECT (prefwin, label60, "label60");
+ GLADE_HOOKUP_OBJECT (prefwin, listview_even_row, "listview_even_row");
+ GLADE_HOOKUP_OBJECT (prefwin, listview_odd_row, "listview_odd_row");
+ GLADE_HOOKUP_OBJECT (prefwin, label77, "label77");
+ GLADE_HOOKUP_OBJECT (prefwin, label78, "label78");
+ GLADE_HOOKUP_OBJECT (prefwin, listview_selected_row, "listview_selected_row");
+ GLADE_HOOKUP_OBJECT (prefwin, listview_text, "listview_text");
GLADE_HOOKUP_OBJECT (prefwin, label61, "label61");
+ GLADE_HOOKUP_OBJECT (prefwin, listview_selected_text, "listview_selected_text");
GLADE_HOOKUP_OBJECT (prefwin, label62, "label62");
- GLADE_HOOKUP_OBJECT (prefwin, color_even_row, "color_even_row");
- GLADE_HOOKUP_OBJECT (prefwin, color_odd_row, "color_odd_row");
- GLADE_HOOKUP_OBJECT (prefwin, color_text, "color_text");
- GLADE_HOOKUP_OBJECT (prefwin, color_selected_text, "color_selected_text");
- GLADE_HOOKUP_OBJECT (prefwin, color_cursor, "color_cursor");
- GLADE_HOOKUP_OBJECT (prefwin, disable_playlist_theming, "disable_playlist_theming");
+ GLADE_HOOKUP_OBJECT (prefwin, listview_cursor, "listview_cursor");
+ GLADE_HOOKUP_OBJECT (prefwin, label75, "label75");
GLADE_HOOKUP_OBJECT (prefwin, label2, "label2");
GLADE_HOOKUP_OBJECT (prefwin, vbox11, "vbox11");
GLADE_HOOKUP_OBJECT (prefwin, pref_network_enableproxy, "pref_network_enableproxy");
diff --git a/plugins/gtkui/plcommon.c b/plugins/gtkui/plcommon.c
index 937948d9..24cf6c0c 100644
--- a/plugins/gtkui/plcommon.c
+++ b/plugins/gtkui/plcommon.c
@@ -78,8 +78,18 @@ void draw_column_data (DdbListview *listview, GdkDrawable *drawable, DdbListview
return;
}
DB_playItem_t *playing_track = deadbeef->streamer_get_playing_track ();
+ int theming = !gtkui_override_listview_colors ();
+
if (cinf->id == DB_COLUMN_ALBUM_ART) {
- gtk_paint_flat_box (theme_treeview->style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE, NULL, theme_treeview, "cell_even_ruled", x, y, width, height);
+ if (theming) {
+ gtk_paint_flat_box (theme_treeview->style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_NONE, NULL, theme_treeview, "cell_even_ruled", x, y, width, height);
+ }
+ else {
+ GdkGC *gc = gdk_gc_new (drawable);
+ gdk_gc_set_rgb_fg_color (gc, gtkui_get_listview_even_row_color ());
+ gdk_draw_rectangle (drawable, gc, TRUE, x, y, width, height);
+ g_object_unref (gc);
+ }
int art_width = width - ART_PADDING_HORZ * 2;
int art_y = y; // dest y
int art_h = height;
@@ -135,11 +145,21 @@ void draw_column_data (DdbListview *listview, GdkDrawable *drawable, DdbListview
char text[1024];
deadbeef->pl_format_title (it, -1, text, sizeof (text), cinf->id, cinf->format);
GdkColor *color = NULL;
- if (deadbeef->pl_is_selected (it)) {
- color = &theme_treeview->style->text[GTK_STATE_SELECTED];
+ if (theming) {
+ if (deadbeef->pl_is_selected (it)) {
+ color = &theme_treeview->style->text[GTK_STATE_SELECTED];
+ }
+ else {
+ color = &theme_treeview->style->text[GTK_STATE_NORMAL];
+ }
}
else {
- color = &theme_treeview->style->text[GTK_STATE_NORMAL];
+ if (deadbeef->pl_is_selected (it)) {
+ color = gtkui_get_listview_selected_text_color ();
+ }
+ else {
+ color = gtkui_get_listview_text_color ();
+ }
}
float fg[3] = {(float)color->red/0xffff, (float)color->green/0xffff, (float)color->blue/0xffff};
draw_set_fg_color (fg);
diff --git a/plugins/gtkui/prefwin.c b/plugins/gtkui/prefwin.c
index 716e8da5..55a50f41 100644
--- a/plugins/gtkui/prefwin.c
+++ b/plugins/gtkui/prefwin.c
@@ -209,6 +209,23 @@ on_applyhotkeys_clicked (GtkButton *button, gpointer user_da
}
void
+prefwin_init_theme_colors (void) {
+ gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "bar_background")), gtkui_get_bar_background_color ());
+ gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "bar_foreground")), gtkui_get_bar_foreground_color ());
+ gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "tabstrip_dark")), gtkui_get_tabstrip_dark_color ());
+ gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "tabstrip_mid")), gtkui_get_tabstrip_mid_color ());
+ gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "tabstrip_light")), gtkui_get_tabstrip_light_color ());
+ gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "tabstrip_base")), gtkui_get_tabstrip_base_color ());
+ gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "listview_even_row")), gtkui_get_listview_even_row_color ());
+ gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "listview_odd_row")), gtkui_get_listview_odd_row_color ());
+ gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "listview_selected_row")), gtkui_get_listview_selection_color ());
+ gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "listview_text")), gtkui_get_listview_text_color ());
+ gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "listview_selected_text")), gtkui_get_listview_selected_text_color ());
+ gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "listview_cursor")), gtkui_get_listview_cursor_color ());
+
+}
+
+void
on_preferences_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
@@ -263,29 +280,23 @@ on_preferences_activate (GtkMenuItem *menuitem,
// mmb_delete_playlist
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (w, "mmb_delete_playlist")), deadbeef->conf_get_int ("gtkui.mmb_delete_playlist", 0));
- // override colors
- int override = deadbeef->conf_get_int ("gtkui.override_theme_colors", 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (prefwin, "override_theme_colors")), override);
- gtk_widget_set_sensitive (lookup_widget (prefwin, "colors_table"), override);
-
- // colors
- gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "color_selection")), gtkui_get_selection_color ());
-
- gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "color_dark")), gtkui_get_dark_color ());
+ // override bar colors
+ int override = deadbeef->conf_get_int ("gtkui.override_bar_colors", 0);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (prefwin, "override_bar_colors")), override);
+ gtk_widget_set_sensitive (lookup_widget (prefwin, "bar_colors_group"), override);
- gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "color_mid")), gtkui_get_mid_color ());
+ // override tabstrip colors
+ override = deadbeef->conf_get_int ("gtkui.override_tabstrip_colors", 0);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (prefwin, "override_tabstrip_colors")), override);
+ gtk_widget_set_sensitive (lookup_widget (prefwin, "tabstrip_colors_group"), override);
- gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "color_light")), gtkui_get_light_color ());
+ // override listview colors
+ override = deadbeef->conf_get_int ("gtkui.override_listview_colors", 0);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (prefwin, "override_listview_colors")), override);
+ gtk_widget_set_sensitive (lookup_widget (prefwin, "listview_colors_group"), override);
- gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "color_back")), gtkui_get_back_color ());
-
- override = deadbeef->conf_get_int ("gtkui.disable_playlist_theming", 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (prefwin, "disable_playlist_theming")), override);
- gtk_widget_set_sensitive (lookup_widget (prefwin, "listview_colors_table"), override);
- gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "color_even_row")), gtkui_get_even_row_color ());
- gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "color_odd_row")), gtkui_get_odd_row_color ());
- gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "color_text")), gtkui_get_text_color ());
- gtk_color_button_set_color (GTK_COLOR_BUTTON (lookup_widget (prefwin, "color_selected_text")), gtkui_get_selected_text_color ());
+ // colors
+ prefwin_init_theme_colors ();
// network
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (w, "pref_network_enableproxy")), deadbeef->conf_get_int ("network.proxy", 0));
@@ -623,140 +634,220 @@ on_configure_plugin_clicked (GtkButton *button,
}
void
-on_color_light_color_set (GtkColorButton *colorbutton,
+on_tabstrip_light_color_set (GtkColorButton *colorbutton,
gpointer user_data)
{
GdkColor clr;
gtk_color_button_get_color (colorbutton, &clr);
char str[100];
snprintf (str, sizeof (str), "%d %d %d", clr.red, clr.green, clr.blue);
- deadbeef->conf_set_str ("gtkui.color.light", str);
+ deadbeef->conf_set_str ("gtkui.color.tabstrip_light", str);
deadbeef->sendmessage (M_CONFIGCHANGED, 0, 0, 0);
+ gtkui_init_theme_colors ();
+ tabstrip_redraw ();
}
void
-on_color_mid_color_set (GtkColorButton *colorbutton,
+on_tabstrip_mid_color_set (GtkColorButton *colorbutton,
gpointer user_data)
{
GdkColor clr;
gtk_color_button_get_color (colorbutton, &clr);
char str[100];
snprintf (str, sizeof (str), "%d %d %d", clr.red, clr.green, clr.blue);
- deadbeef->conf_set_str ("gtkui.color.mid", str);
+ deadbeef->conf_set_str ("gtkui.color.tabstrip_mid", str);
deadbeef->sendmessage (M_CONFIGCHANGED, 0, 0, 0);
+ gtkui_init_theme_colors ();
+ tabstrip_redraw ();
}
void
-on_color_dark_color_set (GtkColorButton *colorbutton,
+on_tabstrip_dark_color_set (GtkColorButton *colorbutton,
gpointer user_data)
{
GdkColor clr;
gtk_color_button_get_color (colorbutton, &clr);
char str[100];
snprintf (str, sizeof (str), "%d %d %d", clr.red, clr.green, clr.blue);
- deadbeef->conf_set_str ("gtkui.color.dark", str);
+ deadbeef->conf_set_str ("gtkui.color.tabstrip_dark", str);
deadbeef->sendmessage (M_CONFIGCHANGED, 0, 0, 0);
+ gtkui_init_theme_colors ();
+ tabstrip_redraw ();
}
-
void
-on_color_selection_color_set (GtkColorButton *colorbutton,
+on_tabstrip_base_color_set (GtkColorButton *colorbutton,
gpointer user_data)
{
GdkColor clr;
gtk_color_button_get_color (colorbutton, &clr);
char str[100];
snprintf (str, sizeof (str), "%d %d %d", clr.red, clr.green, clr.blue);
- deadbeef->conf_set_str ("gtkui.color.selection", str);
+ deadbeef->conf_set_str ("gtkui.color.tabstrip_base", str);
deadbeef->sendmessage (M_CONFIGCHANGED, 0, 0, 0);
-
+ gtkui_init_theme_colors ();
+ tabstrip_redraw ();
}
void
-on_color_back_color_set (GtkColorButton *colorbutton,
+on_bar_foreground_color_set (GtkColorButton *colorbutton,
gpointer user_data)
{
GdkColor clr;
gtk_color_button_get_color (colorbutton, &clr);
char str[100];
snprintf (str, sizeof (str), "%d %d %d", clr.red, clr.green, clr.blue);
- deadbeef->conf_set_str ("gtkui.color.back", str);
+ deadbeef->conf_set_str ("gtkui.color.bar_foreground", str);
deadbeef->sendmessage (M_CONFIGCHANGED, 0, 0, 0);
+ gtkui_init_theme_colors ();
+ seekbar_redraw ();
+ volumebar_redraw ();
}
void
-on_color_even_row_color_set (GtkColorButton *colorbutton,
+on_bar_background_color_set (GtkColorButton *colorbutton,
gpointer user_data)
{
GdkColor clr;
gtk_color_button_get_color (colorbutton, &clr);
char str[100];
snprintf (str, sizeof (str), "%d %d %d", clr.red, clr.green, clr.blue);
- deadbeef->conf_set_str ("gtkui.color.even_row", str);
+ deadbeef->conf_set_str ("gtkui.color.bar_background", str);
deadbeef->sendmessage (M_CONFIGCHANGED, 0, 0, 0);
+ gtkui_init_theme_colors ();
+ seekbar_redraw ();
+ volumebar_redraw ();
+}
+
+void
+on_override_listview_colors_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data)
+{
+ int active = gtk_toggle_button_get_active (togglebutton);
+ deadbeef->conf_set_int ("gtkui.override_listview_colors", active);
+ gtk_widget_set_sensitive (lookup_widget (prefwin, "listview_colors_group"), active);
+ deadbeef->sendmessage (M_CONFIGCHANGED, 0, 0, 0);
+ gtkui_init_theme_colors ();
+ playlist_refresh ();
}
void
-on_color_odd_row_color_set (GtkColorButton *colorbutton,
+on_listview_even_row_color_set (GtkColorButton *colorbutton,
gpointer user_data)
{
GdkColor clr;
gtk_color_button_get_color (colorbutton, &clr);
char str[100];
snprintf (str, sizeof (str), "%d %d %d", clr.red, clr.green, clr.blue);
- deadbeef->conf_set_str ("gtkui.color.odd_row", str);
+ deadbeef->conf_set_str ("gtkui.color.listview_even_row", str);
deadbeef->sendmessage (M_CONFIGCHANGED, 0, 0, 0);
+ gtkui_init_theme_colors ();
+ playlist_refresh ();
}
+void
+on_listview_odd_row_color_set (GtkColorButton *colorbutton,
+ gpointer user_data)
+{
+ GdkColor clr;
+ gtk_color_button_get_color (colorbutton, &clr);
+ char str[100];
+ snprintf (str, sizeof (str), "%d %d %d", clr.red, clr.green, clr.blue);
+ deadbeef->conf_set_str ("gtkui.color.listview_odd_row", str);
+ deadbeef->sendmessage (M_CONFIGCHANGED, 0, 0, 0);
+ gtkui_init_theme_colors ();
+ playlist_refresh ();
+}
+
+void
+on_listview_selected_row_color_set (GtkColorButton *colorbutton,
+ gpointer user_data)
+{
+ GdkColor clr;
+ gtk_color_button_get_color (colorbutton, &clr);
+ char str[100];
+ snprintf (str, sizeof (str), "%d %d %d", clr.red, clr.green, clr.blue);
+ deadbeef->conf_set_str ("gtkui.color.listview_selection", str);
+ deadbeef->sendmessage (M_CONFIGCHANGED, 0, 0, 0);
+ gtkui_init_theme_colors ();
+ playlist_refresh ();
+}
void
-on_color_text_color_set (GtkColorButton *colorbutton,
+on_listview_text_color_set (GtkColorButton *colorbutton,
gpointer user_data)
{
GdkColor clr;
gtk_color_button_get_color (colorbutton, &clr);
char str[100];
snprintf (str, sizeof (str), "%d %d %d", clr.red, clr.green, clr.blue);
- deadbeef->conf_set_str ("gtkui.color.text", str);
+ deadbeef->conf_set_str ("gtkui.color.listview_text", str);
deadbeef->sendmessage (M_CONFIGCHANGED, 0, 0, 0);
+ gtkui_init_theme_colors ();
+ playlist_refresh ();
}
void
-on_color_selected_text_color_set (GtkColorButton *colorbutton,
+on_listview_selected_text_color_set (GtkColorButton *colorbutton,
gpointer user_data)
{
GdkColor clr;
gtk_color_button_get_color (colorbutton, &clr);
char str[100];
snprintf (str, sizeof (str), "%d %d %d", clr.red, clr.green, clr.blue);
- deadbeef->conf_set_str ("gtkui.color.selected_text", str);
+ deadbeef->conf_set_str ("gtkui.color.listview_selected_text", str);
deadbeef->sendmessage (M_CONFIGCHANGED, 0, 0, 0);
+ gtkui_init_theme_colors ();
+ playlist_refresh ();
}
void
-on_override_gtk_colors_toggled (GtkToggleButton *togglebutton,
+on_listview_cursor_color_set (GtkColorButton *colorbutton,
+ gpointer user_data)
+{
+ GdkColor clr;
+ gtk_color_button_get_color (colorbutton, &clr);
+ char str[100];
+ snprintf (str, sizeof (str), "%d %d %d", clr.red, clr.green, clr.blue);
+ deadbeef->conf_set_str ("gtkui.color.listview_cursor", str);
+ deadbeef->sendmessage (M_CONFIGCHANGED, 0, 0, 0);
+ gtkui_init_theme_colors ();
+ playlist_refresh ();
+}
+
+
+void
+on_override_bar_colors_toggled (GtkToggleButton *togglebutton,
gpointer user_data)
{
int active = gtk_toggle_button_get_active (togglebutton);
- deadbeef->conf_set_int ("gtkui.override_theme_colors", active);
- gtk_widget_set_sensitive (lookup_widget (prefwin, "colors_table"), active);
+ deadbeef->conf_set_int ("gtkui.override_bar_colors", active);
+ gtk_widget_set_sensitive (lookup_widget (prefwin, "bar_colors_group"), active);
deadbeef->sendmessage (M_CONFIGCHANGED, 0, 0, 0);
+ gtkui_init_theme_colors ();
+ prefwin_init_theme_colors ();
+ seekbar_redraw ();
+ volumebar_redraw ();
}
+
void
-on_disable_playlist_theming_toggled (GtkToggleButton *togglebutton,
+on_override_tabstrip_colors_toggled (GtkToggleButton *togglebutton,
gpointer user_data)
{
int active = gtk_toggle_button_get_active (togglebutton);
- deadbeef->conf_set_int ("gtkui.disable_playlist_theming", active);
- gtk_widget_set_sensitive (lookup_widget (prefwin, "listview_colors_table"), active);
+ deadbeef->conf_set_int ("gtkui.override_tabstrip_colors", active);
+ gtk_widget_set_sensitive (lookup_widget (prefwin, "tabstrip_colors_group"), active);
deadbeef->sendmessage (M_CONFIGCHANGED, 0, 0, 0);
+ gtkui_init_theme_colors ();
+ prefwin_init_theme_colors ();
+ tabstrip_redraw ();
}
void