port 0.5 GPU scaling increments/window sizes to GTK3

This commit is contained in:
thesource 2024-11-06 09:24:57 +03:00 committed by rofl0r
parent 3b1989a9d9
commit 2c7fac57ff
3 changed files with 24 additions and 1 deletions

View File

@ -118,6 +118,7 @@
<object class="GtkSpinButton" id="gpuscale"> <object class="GtkSpinButton" id="gpuscale">
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="numeric">True</property> <property name="numeric">True</property>
<property name="digits">1</property>
</object> </object>
<packing> <packing>
<property name="left-attach">1</property> <property name="left-attach">1</property>

View File

@ -307,7 +307,9 @@ enum winsize_enum {
WINSIZE_2 = 4, WINSIZE_2 = 4,
WINSIZE_2HALF = 5, WINSIZE_2HALF = 5,
WINSIZE_3 = 6, WINSIZE_3 = 6,
WINSIZE_3HALF = 7,
WINSIZE_4 = 8, WINSIZE_4 = 8,
WINSIZE_4HALF = 9,
WINSIZE_5 = 10, WINSIZE_5 = 10,
}; };
@ -1332,8 +1334,12 @@ static void SetWinsize(GSimpleAction *action, GVariant *parameter, gpointer user
winsize = WINSIZE_2HALF; winsize = WINSIZE_2HALF;
else if (strcmp(string, "3") == 0) else if (strcmp(string, "3") == 0)
winsize = WINSIZE_3; winsize = WINSIZE_3;
else if (strcmp(string, "3.5") == 0)
winsize = WINSIZE_3HALF;
else if (strcmp(string, "4") == 0) else if (strcmp(string, "4") == 0)
winsize = WINSIZE_4; winsize = WINSIZE_4;
else if (strcmp(string, "4.5") == 0)
winsize = WINSIZE_4HALF;
else if (strcmp(string, "5") == 0) else if (strcmp(string, "5") == 0)
winsize = WINSIZE_5; winsize = WINSIZE_5;
winsize_current = winsize; winsize_current = winsize;
@ -2296,7 +2302,7 @@ static void GraphicsSettingsDialog(GSimpleAction *action, GVariant *parameter, g
wScale = GTK_COMBO_BOX(gtk_builder_get_object(builder, "scale")); wScale = GTK_COMBO_BOX(gtk_builder_get_object(builder, "scale"));
wGPUScale = GTK_SPIN_BUTTON(gtk_builder_get_object(builder, "gpuscale")); wGPUScale = GTK_SPIN_BUTTON(gtk_builder_get_object(builder, "gpuscale"));
gtk_spin_button_set_range(wGPUScale, GPU_SCALE_FACTOR_MIN, GPU_SCALE_FACTOR_MAX); gtk_spin_button_set_range(wGPUScale, GPU_SCALE_FACTOR_MIN, GPU_SCALE_FACTOR_MAX);
gtk_spin_button_set_increments(wGPUScale, 1.0, 1.0); gtk_spin_button_set_increments(wGPUScale, 0.5, 1.0);
wMultisample = GTK_COMBO_BOX(gtk_builder_get_object(builder, "multisample")); wMultisample = GTK_COMBO_BOX(gtk_builder_get_object(builder, "multisample"));
wPosterize = GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "posterize")); wPosterize = GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "posterize"));
wSmoothing = GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "smoothing")); wSmoothing = GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "smoothing"));
@ -3774,9 +3780,15 @@ common_gtk_main(GApplication *app, gpointer user_data)
case WINSIZE_3: case WINSIZE_3:
string = "3"; string = "3";
break; break;
case WINSIZE_3HALF:
string = "3.5";
break;
case WINSIZE_4: case WINSIZE_4:
string = "4"; string = "4";
break; break;
case WINSIZE_4HALF:
string = "4.5";
break;
case WINSIZE_5: case WINSIZE_5:
string = "5"; string = "5";
break; break;

View File

@ -334,11 +334,21 @@
<attribute name='action'>app.winsize</attribute> <attribute name='action'>app.winsize</attribute>
<attribute name='target'>3</attribute> <attribute name='target'>3</attribute>
</item> </item>
<item>
<attribute name='label' translatable='yes'>3.5×</attribute>
<attribute name='action'>app.winsize</attribute>
<attribute name='target'>3.5</attribute>
</item>
<item> <item>
<attribute name='label' translatable='yes'>_4×</attribute> <attribute name='label' translatable='yes'>_4×</attribute>
<attribute name='action'>app.winsize</attribute> <attribute name='action'>app.winsize</attribute>
<attribute name='target'>4</attribute> <attribute name='target'>4</attribute>
</item> </item>
<item>
<attribute name='label' translatable='yes'>4.5×</attribute>
<attribute name='action'>app.winsize</attribute>
<attribute name='target'>4.5</attribute>
</item>
<item> <item>
<attribute name='label' translatable='yes'>_5×</attribute> <attribute name='label' translatable='yes'>_5×</attribute>
<attribute name='action'>app.winsize</attribute> <attribute name='action'>app.winsize</attribute>