summaryrefslogtreecommitdiffstats
path: root/gtk/src
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/src')
-rw-r--r--gtk/src/callbacks.c1
-rw-r--r--gtk/src/ghb.ui2
-rw-r--r--gtk/src/internal_defaults.xml4
-rw-r--r--gtk/src/preview.c53
-rw-r--r--gtk/src/preview.h1
-rw-r--r--gtk/src/settings.c12
-rw-r--r--gtk/src/widgetdeps.c2
7 files changed, 48 insertions, 27 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 27c879380..4cd6447f4 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -1450,6 +1450,7 @@ title_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
set_destination(ud);
}
+ ghb_preview_set_visible(ud);
}
G_MODULE_EXPORT void
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui
index 43ed3c50d..eabbd7077 100644
--- a/gtk/src/ghb.ui
+++ b/gtk/src/ghb.ui
@@ -4728,7 +4728,7 @@ Requires subme >= 6 and trellis >= 1.</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<child>
<object class="GtkTextView" id="activity_view">
- <property name="width_request">400</property>
+ <property name="width_request">500</property>
<property name="height_request">500</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
diff --git a/gtk/src/internal_defaults.xml b/gtk/src/internal_defaults.xml
index 91025828c..991f56b68 100644
--- a/gtk/src/internal_defaults.xml
+++ b/gtk/src/internal_defaults.xml
@@ -36,6 +36,10 @@
<integer>0</integer>
<key>show_crop</key>
<false />
+ <key>hide_settings</key>
+ <false />
+ <key>show_picture</key>
+ <false />
<key>single_title</key>
<integer>1</integer>
<key>start_chapter</key>
diff --git a/gtk/src/preview.c b/gtk/src/preview.c
index 9fd92bf53..796867817 100644
--- a/gtk/src/preview.c
+++ b/gtk/src/preview.c
@@ -831,25 +831,38 @@ set_visible(GtkWidget *widget, gboolean visible)
}
}
-G_MODULE_EXPORT void
-preview_button_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
+void
+ghb_preview_set_visible(signal_user_data_t *ud)
{
gint titleindex;
+ GtkWidget *widget;
+ gboolean settings_active;
- g_debug("preview_button_clicked_cb()");
+ settings_active = ghb_settings_get_boolean(ud->settings, "show_picture");
+ widget = GHB_WIDGET (ud->builder, "preview_window");
titleindex = ghb_settings_combo_int(ud->settings, "title");
- if (titleindex >= 0)
+ if (settings_active && titleindex >= 0)
{
gint x, y;
- GtkWidget *widget = GHB_WIDGET (ud->builder, "preview_window");
x = ghb_settings_get_int(ud->settings, "preview_x");
y = ghb_settings_get_int(ud->settings, "preview_y");
if (x >= 0 && y >= 0)
gtk_window_move(GTK_WINDOW(widget), x, y);
- set_visible(widget, gtk_toggle_button_get_active(
- GTK_TOGGLE_BUTTON(xwidget)));
+ set_visible(widget,
+ ghb_settings_get_boolean(ud->settings, "show_preview"));
+ }
+ else
+ {
+ set_visible(widget, FALSE);
}
+}
+
+G_MODULE_EXPORT void
+preview_button_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
+{
+ g_debug("preview_button_clicked_cb()");
ghb_widget_to_setting (ud->settings, xwidget);
+ ghb_preview_set_visible(ud);
ghb_check_dependency(ud, xwidget, NULL);
const gchar *name = gtk_widget_get_name(xwidget);
ghb_pref_save(ud->settings, name);
@@ -858,33 +871,23 @@ preview_button_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
G_MODULE_EXPORT void
picture_settings_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
{
- GtkWidget *widget, *toggle;
+ GtkWidget *widget;
gboolean active, hide_settings;
gint x, y;
g_debug("picture_settings_clicked_cb()");
- toggle = GHB_WIDGET (ud->builder, "hide_settings");
- hide_settings = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle));
+ ghb_widget_to_setting (ud->settings, xwidget);
+
+ hide_settings = ghb_settings_get_boolean(ud->settings, "hide_settings");
+ active = ghb_settings_get_boolean(ud->settings, "show_picture");
widget = GHB_WIDGET (ud->builder, "settings_window");
- active = gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(xwidget));
x = ghb_settings_get_int(ud->settings, "settings_x");
y = ghb_settings_get_int(ud->settings, "settings_y");
if (x >= 0 && y >= 0)
gtk_window_move(GTK_WINDOW(widget), x, y);
set_visible(widget, active && !hide_settings);
- if (ghb_settings_get_boolean(ud->settings, "show_preview"))
- {
- widget = GHB_WIDGET (ud->builder, "preview_window");
- x = ghb_settings_get_int(ud->settings, "preview_x");
- y = ghb_settings_get_int(ud->settings, "preview_y");
- if (x >= 0 && y >= 0)
- gtk_window_move(GTK_WINDOW(widget), x, y);
- set_visible(widget, active);
- // The window may be hidden behind the main window, raise it
- if (active)
- gtk_window_present(GTK_WINDOW(widget));
- }
+ ghb_preview_set_visible(ud);
}
G_MODULE_EXPORT void
@@ -949,8 +952,10 @@ picture_settings_alt2_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
GtkWidget *window;
g_debug("picture_settings_alt2_clicked_cb()");
+ ghb_widget_to_setting (ud->settings, xwidget);
+ active = ghb_settings_get_boolean(ud->settings, "hide_settings");
+
toggle = GHB_WIDGET (ud->builder, "hide_settings");
- active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle));
window = GHB_WIDGET(ud->builder, "settings_window");
if (!active)
{
diff --git a/gtk/src/preview.h b/gtk/src/preview.h
index b30d1a909..f89e4f335 100644
--- a/gtk/src/preview.h
+++ b/gtk/src/preview.h
@@ -27,5 +27,6 @@ void ghb_live_encode_done(signal_user_data_t *ud, gboolean success);
void ghb_preview_cleanup(signal_user_data_t *ud);
void ghb_live_reset(signal_user_data_t *ud);
void ghb_par_scale(signal_user_data_t *ud, gint *width, gint *height, gint par_n, gint par_d);
+void ghb_preview_set_visible(signal_user_data_t *ud);
#endif // _GHB_PREVIEW_H_
diff --git a/gtk/src/settings.c b/gtk/src/settings.c
index 20cdb38c9..3e3de4ba0 100644
--- a/gtk/src/settings.c
+++ b/gtk/src/settings.c
@@ -238,6 +238,13 @@ ghb_widget_value(GtkWidget *widget)
bval = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
value = ghb_boolean_value_new(bval);
}
+ else if (type == GTK_TYPE_TOGGLE_TOOL_BUTTON)
+ {
+ g_debug("\ttoggle_tool_button");
+ gboolean bval;
+ bval = gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(widget));
+ value = ghb_boolean_value_new(bval);
+ }
else if (type == GTK_TYPE_TOGGLE_BUTTON)
{
g_debug("\ttoggle_button");
@@ -480,6 +487,11 @@ update_widget(GtkWidget *widget, const GValue *value)
g_debug("check button");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), ival);
}
+ else if (type == GTK_TYPE_TOGGLE_TOOL_BUTTON)
+ {
+ g_debug("toggle button");
+ gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(widget), ival);
+ }
else if (type == GTK_TYPE_TOGGLE_BUTTON)
{
g_debug("toggle button");
diff --git a/gtk/src/widgetdeps.c b/gtk/src/widgetdeps.c
index 929ddb2c0..a9c372682 100644
--- a/gtk/src/widgetdeps.c
+++ b/gtk/src/widgetdeps.c
@@ -18,8 +18,6 @@ static dependency_t dep_map[] =
{
{"title", "queue_add", "none", TRUE, FALSE},
{"title", "queue_add_menu", "none", TRUE, FALSE},
- {"title", "show_picture", "none", TRUE, FALSE},
- {"title", "show_preview_menu", "none", TRUE, FALSE},
{"title", "preview_frame", "none", TRUE, FALSE},
{"title", "picture_label", "none", TRUE, FALSE},
{"title", "picture_tab", "none", TRUE, FALSE},