summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-11-02 18:26:11 +0000
committerjstebbins <[email protected]>2009-11-02 18:26:11 +0000
commit7b2c8b07f3d88767f13850d5743092e4e043b212 (patch)
treebb8393e5824073cf5ba07641f976821ce2721e74 /gtk
parent1e6b191a97edad3cd634b4972f53873d3d5001d9 (diff)
LinGui: use a smaller font in audio settings controls
allows a small reduction in the width of the main window. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2910 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/ghb.ui3
-rw-r--r--gtk/src/hb-backend.c63
-rw-r--r--gtk/src/main.c10
-rw-r--r--gtk/src/preview.c9
4 files changed, 68 insertions, 17 deletions
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui
index 7a8b1f0d3..8319f0e5b 100644
--- a/gtk/src/ghb.ui
+++ b/gtk/src/ghb.ui
@@ -2031,7 +2031,7 @@ FFmpeg's and Theora's scale is more linear. These encoders do not have a lossle
<property name="n_columns">7</property>
<child>
<object class="GtkComboBox" id="AudioTrack">
- <property name="width_request">215</property>
+ <property name="width_request">180</property>
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip-text" translatable="yes">List of audio tracks available from your source.</property>
@@ -2211,6 +2211,7 @@ For source audio that has a wide dynamic range (very loud and very soft sequence
<property name="right_attach">3</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
</packing>
</child>
</object>
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index 6dc26275c..b2a19eb13 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -1494,7 +1494,7 @@ init_combo_box(GtkBuilder *builder, const gchar *name)
cell = GTK_CELL_RENDERER(gtk_cell_renderer_text_new());
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), cell, TRUE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), cell,
- "text", 0, "sensitive", 1, NULL);
+ "markup", 0, "sensitive", 1, NULL);
}
else
{ // Combo box entry
@@ -1508,6 +1508,7 @@ audio_samplerate_opts_set(GtkBuilder *builder, const gchar *name, hb_rate_t *rat
GtkTreeIter iter;
GtkListStore *store;
gint ii;
+ gchar *str;
g_debug("audio_samplerate_opts_set ()\n");
store = get_combo_box_store(builder, name);
@@ -1515,7 +1516,7 @@ audio_samplerate_opts_set(GtkBuilder *builder, const gchar *name, hb_rate_t *rat
// Add an item for "Same As Source"
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
- 0, "Same as source",
+ 0, "<small>Same as source</small>",
1, TRUE,
2, "source",
3, 0.0,
@@ -1524,13 +1525,15 @@ audio_samplerate_opts_set(GtkBuilder *builder, const gchar *name, hb_rate_t *rat
for (ii = 0; ii < count; ii++)
{
gtk_list_store_append(store, &iter);
+ str = g_strdup_printf("<small>%s</small>", rates[ii].string);
gtk_list_store_set(store, &iter,
- 0, rates[ii].string,
+ 0, str,
1, TRUE,
2, rates[ii].string,
3, (gdouble)rates[ii].rate,
4, rates[ii].string,
-1);
+ g_free(str);
}
}
@@ -1588,13 +1591,14 @@ mix_opts_set(GtkBuilder *builder, const gchar *name)
GtkTreeIter iter;
GtkListStore *store;
gint ii;
+ gchar *str;
g_debug("mix_opts_set ()\n");
store = get_combo_box_store(builder, name);
gtk_list_store_clear(store);
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
- 0, "None",
+ 0, "<small>None</small>",
1, TRUE,
2, "none",
3, 0.0,
@@ -1603,13 +1607,16 @@ mix_opts_set(GtkBuilder *builder, const gchar *name)
for (ii = 0; ii < hb_audio_mixdowns_count; ii++)
{
gtk_list_store_append(store, &iter);
+ str = g_strdup_printf("<small>%s</small>",
+ hb_audio_mixdowns[ii].human_readable_name);
gtk_list_store_set(store, &iter,
- 0, hb_audio_mixdowns[ii].human_readable_name,
+ 0, str,
1, TRUE,
2, hb_audio_mixdowns[ii].short_name,
3, (gdouble)hb_audio_mixdowns[ii].amixdown,
4, hb_audio_mixdowns[ii].internal_name,
-1);
+ g_free(str);
}
}
@@ -1781,6 +1788,7 @@ audio_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex)
hb_audio_config_t * audio;
gint ii;
gint count = 0;
+ gchar *str;
g_debug("audio_track_opts_set ()\n");
store = get_combo_box_store(builder, name);
@@ -1811,7 +1819,7 @@ audio_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex)
// No audio. set some default
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
- 0, "No Audio",
+ 0, "<small>No Audio</small>",
1, TRUE,
2, "none",
3, -1.0,
@@ -1828,13 +1836,15 @@ audio_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex)
{
audio = (hb_audio_config_t *) hb_list_audio_config_item( title->list_audio, ii );
gtk_list_store_append(store, &iter);
+ str = g_strdup_printf("<small>%s</small>", audio->lang.description);
gtk_list_store_set(store, &iter,
- 0, audio->lang.description,
+ 0, str,
1, TRUE,
2, index_str[ii],
3, (gdouble)ii,
4, index_str[ii],
-1);
+ g_free(str);
audio_track_opts.map[ii].option = audio->lang.description,
audio_track_opts.map[ii].shortOpt = index_str[ii];
audio_track_opts.map[ii].ivalue = ii;
@@ -2283,6 +2293,33 @@ generic_opts_set(GtkBuilder *builder, const gchar *name, combo_opts_t *opts)
}
}
+static void
+small_opts_set(GtkBuilder *builder, const gchar *name, combo_opts_t *opts)
+{
+ GtkTreeIter iter;
+ GtkListStore *store;
+ gint ii;
+ gchar *str;
+
+ g_debug("generic_opts_set ()\n");
+ if (name == NULL || opts == NULL) return;
+ store = get_combo_box_store(builder, name);
+ gtk_list_store_clear(store);
+ for (ii = 0; ii < opts->count; ii++)
+ {
+ gtk_list_store_append(store, &iter);
+ str = g_strdup_printf("<small>%s</small>", opts->map[ii].option);
+ gtk_list_store_set(store, &iter,
+ 0, str,
+ 1, TRUE,
+ 2, opts->map[ii].shortOpt,
+ 3, opts->map[ii].ivalue,
+ 4, opts->map[ii].svalue,
+ -1);
+ g_free(str);
+ }
+}
+
combo_opts_t*
find_combo_table(const gchar *name)
{
@@ -2454,7 +2491,7 @@ ghb_update_ui_combo_box(
generic_opts_set(ud->builder, "PictureDecomb", &decomb_opts);
generic_opts_set(ud->builder, "PictureDenoise", &denoise_opts);
generic_opts_set(ud->builder, "VideoEncoder", &vcodec_opts);
- generic_opts_set(ud->builder, "AudioEncoder", &acodec_opts);
+ small_opts_set(ud->builder, "AudioEncoder", &acodec_opts);
generic_opts_set(ud->builder, "x264_direct", &direct_opts);
generic_opts_set(ud->builder, "x264_b_adapt", &badapt_opts);
generic_opts_set(ud->builder, "x264_me", &me_opts);
@@ -2619,14 +2656,14 @@ audio_bitrate_opts_add(GtkBuilder *builder, const gchar *name, gint rate)
GtkListStore *store;
gchar *str;
- g_debug("audio_rate_opts_add ()\n");
+ g_debug("audio_bitrate_opts_add ()\n");
if (rate < 8) return;
store = get_combo_box_store(builder, name);
if (!find_combo_item_by_int(GTK_TREE_MODEL(store), rate, &iter))
{
- str = g_strdup_printf ("%d", rate);
+ str = g_strdup_printf ("<small>%d</small>", rate);
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
0, str,
@@ -2683,6 +2720,7 @@ audio_bitrate_opts_set(GtkBuilder *builder, const gchar *name)
GtkTreeIter iter;
GtkListStore *store;
gint ii;
+ gchar *str;
g_debug("audio_bitrate_opts_set ()\n");
store = get_combo_box_store(builder, name);
@@ -2690,13 +2728,16 @@ audio_bitrate_opts_set(GtkBuilder *builder, const gchar *name)
for (ii = 0; ii < hb_audio_bitrates_count; ii++)
{
gtk_list_store_append(store, &iter);
+ str = g_strdup_printf ("<small>%s</small>",
+ hb_audio_bitrates[ii].string);
gtk_list_store_set(store, &iter,
- 0, hb_audio_bitrates[ii].string,
+ 0, str,
1, TRUE,
2, hb_audio_bitrates[ii].string,
3, (gdouble)hb_audio_bitrates[ii].rate,
4, hb_audio_bitrates[ii].string,
-1);
+ g_free(str);
}
}
diff --git a/gtk/src/main.c b/gtk/src/main.c
index 3b3ab25b5..2c3c47eb7 100644
--- a/gtk/src/main.c
+++ b/gtk/src/main.c
@@ -342,14 +342,14 @@ bind_audio_tree_model (signal_user_data_t *ud)
column = gtk_tree_view_column_new_with_attributes(
_("Track"), cell, "text", 0, NULL);
gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column));
- gtk_tree_view_column_set_min_width (column, 210);
- gtk_tree_view_column_set_max_width (column, 210);
+ gtk_tree_view_column_set_min_width (column, 200);
+ gtk_tree_view_column_set_max_width (column, 200);
cell = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(
_("Codec"), cell, "text", 1, NULL);
gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column));
- gtk_tree_view_column_set_min_width (column, 130);
+ gtk_tree_view_column_set_min_width (column, 105);
cell = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(
@@ -361,13 +361,13 @@ bind_audio_tree_model (signal_user_data_t *ud)
column = gtk_tree_view_column_new_with_attributes(
_("Sample Rate"), cell, "text", 3, NULL);
gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column));
- gtk_tree_view_column_set_min_width (column, 130);
+ gtk_tree_view_column_set_min_width (column, 105);
cell = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(
_("Mix"), cell, "text", 4, NULL);
gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column));
- gtk_tree_view_column_set_min_width (column, 140);
+ gtk_tree_view_column_set_min_width (column, 120);
cell = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(
diff --git a/gtk/src/preview.c b/gtk/src/preview.c
index 796867817..7d8b690fd 100644
--- a/gtk/src/preview.c
+++ b/gtk/src/preview.c
@@ -156,7 +156,11 @@ ghb_preview_init(signal_user_data_t *ud)
GstBus *bus;
GstElement *xover;
+#if !defined(_WIN32)
ud->preview->xid = GDK_DRAWABLE_XID(ud->preview->view->window);
+#else
+ ud->preview->xid = GDK_WINDOW_HWND(ud->preview->view->window);
+#endif
ud->preview->play = gst_element_factory_make("playbin", "play");
//xover = gst_element_factory_make("xvimagesink", "xover");
//xover = gst_element_factory_make("ximagesink", "xover");
@@ -209,8 +213,13 @@ create_window(GstBus *bus, GstMessage *msg, gpointer data)
{
if (!gst_structure_has_name(msg->structure, "prepare-xwindow-id"))
return GST_BUS_PASS;
+#if !defined(_WIN32)
gst_x_overlay_set_xwindow_id(
GST_X_OVERLAY(GST_MESSAGE_SRC(msg)), preview->xid);
+#else
+ gst_directdraw_sink_set_window_id(
+ GST_X_OVERLAY(GST_MESSAGE_SRC(msg)), preview->xid);
+#endif
gst_message_unref(msg);
return GST_BUS_DROP;
} break;