GTK: Break display settings into tabs.

This commit is contained in:
Brandon Wright 2019-02-17 20:55:59 -06:00
parent 33db8a355b
commit 191b82f14d
4 changed files with 429 additions and 472 deletions

View File

@ -115,6 +115,7 @@ int Snes9xConfig::load_defaults ()
preferences_height = -1;
shader_parameters_width = -1;
shader_parameters_height = -1;
current_display_tab = 0;
sram_directory.clear ();
export_directory.clear ();
savestate_directory.clear ();
@ -306,6 +307,7 @@ int Snes9xConfig::save_config_file ()
cf.SetInt (z"PreferencesHeight", preferences_height);
cf.SetInt (z"ShaderParametersWidth", shader_parameters_width);
cf.SetInt (z"ShaderParametersHeight", shader_parameters_height);
cf.SetInt (z"CurrentDisplayTab", current_display_tab);
outbool (cf, z"UIVisible", ui_visible);
outbool (cf, z"StatusBarVisible", statusbar_visible);
if (default_esc_behavior != ESC_TOGGLE_MENUBAR)
@ -535,6 +537,7 @@ int Snes9xConfig::load_config_file ()
inint (z"PreferencesHeight", preferences_height);
inint (z"ShaderParametersWidth", shader_parameters_width);
inint (z"ShaderParametersHeight", shader_parameters_height);
inint (z"CurrentDisplayTab", current_display_tab);
inbool (z"UIVisible", ui_visible);
inbool (z"StatusBarVisible", statusbar_visible);
inbool (z"Fullscreen", fullscreen);

View File

@ -127,6 +127,7 @@ class Snes9xConfig
int window_width, window_height;
int preferences_width, preferences_height;
int shader_parameters_width, shader_parameters_height;
int current_display_tab;
bool pause_emulation_on_switch;
int num_threads;
bool screensaver_needs_reset;

View File

@ -336,20 +336,20 @@ event_scale_method_changed (GtkComboBox *widget, gpointer user_data)
if (gtk_combo_box_get_active (combo) == FILTER_NTSC)
{
gtk_widget_show (window->get_widget ("ntsc_frame"));
gtk_widget_show (window->get_widget ("ntsc_alignment"));
}
else
{
gtk_widget_hide (window->get_widget ("ntsc_frame"));
gtk_widget_hide (window->get_widget ("ntsc_alignment"));
}
if (gtk_combo_box_get_active (combo) == FILTER_SCANLINES)
{
gtk_widget_show (window->get_widget ("scanline_filter_frame"));
gtk_widget_show (window->get_widget ("scanline_alignment"));
}
else
{
gtk_widget_hide (window->get_widget ("scanline_filter_frame"));
gtk_widget_hide (window->get_widget ("scanline_alignment"));
}
}
@ -660,20 +660,20 @@ Snes9xPreferences::move_settings_to_dialog ()
if (config->scale_method == FILTER_NTSC)
{
gtk_widget_show (get_widget ("ntsc_frame"));
gtk_widget_show (get_widget ("ntsc_alignment"));
}
else
{
gtk_widget_hide (get_widget ("ntsc_frame"));
gtk_widget_hide (get_widget ("ntsc_alignment"));
}
if (config->scale_method == FILTER_SCANLINES)
{
gtk_widget_show (get_widget ("scanline_filter_frame"));
gtk_widget_show (get_widget ("scanline_alignment"));
}
else
{
gtk_widget_hide (get_widget ("scanline_filter_frame"));
gtk_widget_hide (get_widget ("scanline_alignment"));
}
load_ntsc_settings ();
@ -1087,6 +1087,8 @@ Snes9xPreferences::show ()
if (config->preferences_width > 0 && config->preferences_height > 0)
resize (config->preferences_width, config->preferences_height);
gtk_notebook_set_current_page(GTK_NOTEBOOK(get_widget("display_notebook")), config->current_display_tab);
for (close_dialog = false; !close_dialog; )
{
gtk_widget_show (window);
@ -1094,6 +1096,7 @@ Snes9xPreferences::show ()
config->preferences_width = get_width ();
config->preferences_height = get_height ();
config->current_display_tab = gtk_notebook_get_current_page(GTK_NOTEBOOK(get_widget("display_notebook")));
switch (result)
{

View File

@ -2701,37 +2701,17 @@
<property name="can_focus">True</property>
<signal name="switch-page" handler="change_current_page" swapped="no"/>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<object class="GtkNotebook" id="display_notebook">
<property name="visible">True</property>
<property name="can_focus">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="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkViewport" id="display_viewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="resize_mode">queue</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<child>
<object class="GtkFrame" id="frame11">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment15">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">5</property>
<property name="top_padding">12</property>
<property name="bottom_padding">5</property>
<property name="left_padding">12</property>
<property name="right_padding">12</property>
<child>
<object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
@ -2849,34 +2829,44 @@
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label2">
<child type="tab">
<object class="GtkLabel" id="basiclabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Basic Settings&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
<property name="label" translatable="yes">Basic Settings</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame12">
<object class="GtkScrolledWindow" id="scalingscrolledwindow">
<property name="visible">True</property>
<property name="can_focus">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="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkViewport" id="scalingscrolledwindowviewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="resize_mode">queue</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkVBox" id="scalingvbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">0</property>
<child>
<object class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">5</property>
<property name="top_padding">12</property>
<property name="bottom_padding">5</property>
<property name="left_padding">12</property>
<property name="right_padding">12</property>
<child>
<object class="GtkVBox" id="vbox5">
<property name="visible">True</property>
@ -2936,7 +2926,7 @@
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
@ -3104,33 +3094,17 @@
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Image Adjustments&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="ntsc_frame">
<object class="GtkAlignment" id="ntsc_alignment">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">5</property>
<property name="top_padding">0</property>
<property name="bottom_padding">5</property>
<property name="left_padding">12</property>
<child>
@ -3657,33 +3631,17 @@
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;NTSC Filter&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="scanline_filter_frame">
<object class="GtkAlignment" id="scanline_alignment">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment19">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">5</property>
<property name="top_padding">0</property>
<property name="bottom_padding">5</property>
<property name="left_padding">12</property>
<child>
@ -3725,35 +3683,36 @@
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label146">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Scanline Filter&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="hwaccel_frame">
</object>
</child>
</object>
</child>
</object>
</child>
<child type="tab">
<object class="GtkLabel" id="scalinglabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<property name="label" translatable="yes">Scaling</property>
</object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">5</property>
<property name="top_padding">12</property>
<property name="bottom_padding">5</property>
<property name="left_padding">12</property>
<property name="right_padding">12</property>
<child>
<object class="GtkVBox" id="vbox7">
<property name="visible">True</property>
@ -4027,27 +3986,18 @@
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label114">
<child type="tab">
<object class="GtkLabel" id="hwaccelerationlabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Hardware Acceleration&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
<property name="label" translatable="yes">Hardware Acceleration</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<child type="tab">
<object class="GtkVBox" id="vbox23">
<property name="visible">True</property>