]> granicus.if.org Git - handbrake/commitdiff
LinGui: customize hud colors
authorjstebbins <jstebbins.hb@gmail.com>
Wed, 8 Apr 2009 23:23:48 +0000 (23:23 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Wed, 8 Apr 2009 23:23:48 +0000 (23:23 +0000)
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

gtk/src/ghbcompositor.c
gtk/src/main.c

index eec5c09afc5813a3a008ce2bf3bbbc75d78495c6..81ac2650ec3447f66c903d47c357747097c25bcb 100644 (file)
@@ -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
index ebb7348d4611398c5ebf7e9bcd8658d69b7118b4..0ea38f4160249d2c210816c1268572078f427af5 100644 (file)
@@ -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);