summaryrefslogtreecommitdiffstats
path: root/gtk/src
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-04-08 23:23:48 +0000
committerjstebbins <[email protected]>2009-04-08 23:23:48 +0000
commitb49fb8b3e06020318570adac2f8a19a3332e15a7 (patch)
tree801888f0b20a9945401b94193edebb73b7a45d08 /gtk/src
parent16159cf96511adeda529ecc555d482454371eba5 (diff)
LinGui: customize hud colors
uses standard rc-file mappings, so user can customize as well git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2313 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src')
-rw-r--r--gtk/src/ghbcompositor.c1
-rw-r--r--gtk/src/main.c32
2 files changed, 23 insertions, 10 deletions
diff --git a/gtk/src/ghbcompositor.c b/gtk/src/ghbcompositor.c
index eec5c09af..81ac2650e 100644
--- a/gtk/src/ghbcompositor.c
+++ b/gtk/src/ghbcompositor.c
@@ -552,7 +552,6 @@ ghb_compositor_size_request(
requisition->width = width + GTK_CONTAINER (widget)->border_width * 2;
requisition->height = height + GTK_CONTAINER (widget)->border_width * 2;
-g_message("request_size %d x %d", requisition->width, requisition->height);
}
static void
diff --git a/gtk/src/main.c b/gtk/src/main.c
index ebb7348d4..0ea38f416 100644
--- a/gtk/src/main.c
+++ b/gtk/src/main.c
@@ -499,6 +499,26 @@ int mm_support();
void x264_entry_changed_cb(GtkWidget *widget, signal_user_data_t *ud);
void preview_window_expose_cb(void);
+// Some style definitions for the preview window and hud
+const gchar *hud_rcstyle =
+"style \"ghb-preview\" {\n"
+"bg[NORMAL]=\"black\"\n"
+"}\n"
+"style \"ghb-hud\" {\n"
+"bg[NORMAL]=\"gray18\"\n"
+"bg[ACTIVE]=\"gray32\"\n"
+"bg[PRELIGHT]=\"gray46\"\n"
+"bg[SELECTED]=\"black\"\n"
+"base[NORMAL]=\"gray40\"\n"
+"text[NORMAL]=\"white\"\n"
+"text[ACTIVE]=\"white\"\n"
+"fg[NORMAL]=\"white\"\n"
+"fg[ACTIVE]=\"white\"\n"
+"fg[PRELIGHT]=\"white\"\n"
+"}\n"
+"widget \"preview_window.*.preview_hud.*\" style \"ghb-hud\"\n"
+"widget \"preview_window\" style \"ghb-preview\"\n";
+
int
main (int argc, char *argv[])
{
@@ -525,6 +545,7 @@ main (int argc, char *argv[])
gtk_set_locale ();
gtk_init (&argc, &argv);
+ gtk_rc_parse_string(hud_rcstyle);
notify_init("HandBrake");
ghb_register_transforms();
ghb_resource_init();
@@ -545,27 +566,20 @@ main (int argc, char *argv[])
ud->builder = create_builder_or_die (BUILDER_NAME);
// Set up the "hud" control overlay for the preview window
- GtkWidget *window, *eb, *draw, *hud, *blender, *align;
- GdkColor color;
+ GtkWidget *draw, *hud, *blender, *align;
- window = GHB_WIDGET(ud->builder, "preview_window");
align = GHB_WIDGET(ud->builder, "preview_window_alignment");
draw = GHB_WIDGET(ud->builder, "preview_image");
hud = GHB_WIDGET(ud->builder, "preview_hud");
- eb = GHB_WIDGET(ud->builder, "preview_event_box");
// Set up compositing for hud
blender = ghb_compositor_new();
+
gtk_container_add(GTK_CONTAINER(align), blender);
ghb_compositor_zlist_insert(GHB_COMPOSITOR(blender), draw, 1, 1);
ghb_compositor_zlist_insert(GHB_COMPOSITOR(blender), hud, 2, .85);
gtk_widget_show(blender);
- gdk_color_parse("black", &color);
- gtk_widget_modify_bg(window, GTK_STATE_NORMAL, &color);
- gdk_color_parse("gray18", &color);
- gtk_widget_modify_bg(eb, GTK_STATE_NORMAL, &color);
-
// Redirect stderr to the activity window
ghb_preview_init(ud);
IoRedirect(ud);