Add Zoom Stepping Value to Preferences
This commit is contained in:
parent
066c5a11c7
commit
13f8171e24
3 changed files with 47 additions and 7 deletions
|
@ -73,9 +73,19 @@ proxy_entry_focus_out_event_cb (GtkEntry* entry,
|
|||
static gboolean
|
||||
proxy_spin_button_changed_cb (GtkSpinButton* button, GObject* object)
|
||||
{
|
||||
gint value = gtk_spin_button_get_value_as_int (button);
|
||||
GObjectClass* class = G_OBJECT_GET_CLASS (object);
|
||||
const gchar* property = g_object_get_data (G_OBJECT (button), "property");
|
||||
g_object_set (object, property, value, NULL);
|
||||
GParamSpec* pspec = g_object_class_find_property (class, property);
|
||||
if (G_PARAM_SPEC_TYPE (pspec) == G_TYPE_PARAM_INT)
|
||||
{
|
||||
gint value = gtk_spin_button_get_value_as_int (button);
|
||||
g_object_set (object, property, value, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
gdouble value = gtk_spin_button_get_value (button);
|
||||
g_object_set (object, property, value, NULL);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -213,6 +223,18 @@ katze_property_proxy (gpointer object,
|
|||
g_signal_connect (widget, "focus-out-event",
|
||||
G_CALLBACK (proxy_entry_focus_out_event_cb), object);
|
||||
}
|
||||
else if (type == G_TYPE_PARAM_FLOAT)
|
||||
{
|
||||
widget = gtk_spin_button_new_with_range (
|
||||
G_PARAM_SPEC_FLOAT (pspec)->minimum,
|
||||
G_PARAM_SPEC_FLOAT (pspec)->maximum, 1);
|
||||
gtk_spin_button_set_digits (GTK_SPIN_BUTTON (widget), 2);
|
||||
gfloat value;
|
||||
g_object_get (object, property, &value, NULL);
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), value);
|
||||
g_signal_connect (widget, "value-changed",
|
||||
G_CALLBACK (proxy_spin_button_changed_cb), object);
|
||||
}
|
||||
else if (type == G_TYPE_PARAM_INT)
|
||||
{
|
||||
widget = gtk_spin_button_new_with_range (
|
||||
|
|
|
@ -125,7 +125,7 @@ settings_new_from_file (const gchar* filename)
|
|||
}
|
||||
else if (type == G_TYPE_PARAM_FLOAT)
|
||||
{
|
||||
gdouble number = sokoke_key_file_get_double_default (key_file,
|
||||
gfloat number = sokoke_key_file_get_double_default (key_file,
|
||||
"settings", property,
|
||||
G_PARAM_SPEC_FLOAT (pspec)->default_value, NULL);
|
||||
g_object_set (settings, property, number, NULL);
|
||||
|
@ -198,7 +198,7 @@ settings_save_to_file (MidoriWebSettings* settings,
|
|||
}
|
||||
else if (type == G_TYPE_PARAM_FLOAT)
|
||||
{
|
||||
gdouble number;
|
||||
gfloat number;
|
||||
g_object_get (settings, property, &number, NULL);
|
||||
g_key_file_set_double (key_file, "settings", property, number);
|
||||
}
|
||||
|
|
|
@ -279,7 +279,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
|
|||
// Page "Behavior"
|
||||
PAGE_NEW (_("Behavior"));
|
||||
FRAME_NEW (_("Features"));
|
||||
TABLE_NEW (5, 2);
|
||||
TABLE_NEW (6, 2);
|
||||
button = katze_property_proxy (settings, "auto-load-images", NULL);
|
||||
INDENTED_ADD (button, 0, 1, 0, 1);
|
||||
button = katze_property_proxy (settings, "auto-shrink-images", NULL);
|
||||
|
@ -304,10 +304,28 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
|
|||
G_CALLBACK (clear_button_clicked_cb), entry);
|
||||
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 4);
|
||||
FILLED_ADD (hbox, 1, 2, 3, 4);
|
||||
if (g_object_class_find_property (G_OBJECT_GET_CLASS (settings), "zoom-step"))
|
||||
{
|
||||
label = katze_property_label (settings, "zoom-step");
|
||||
INDENTED_ADD (label, 0, 1, 4, 5);
|
||||
hbox = gtk_hbox_new (FALSE, 4);
|
||||
entry = katze_property_proxy (settings, "zoom-step", NULL);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
|
||||
FILLED_ADD (hbox, 1, 2, 4, 5);
|
||||
}
|
||||
else
|
||||
{
|
||||
label = gtk_label_new ("Zoom Stepping Value");
|
||||
INDENTED_ADD (label, 0, 1, 4, 5);
|
||||
hbox = gtk_hbox_new (FALSE, 4);
|
||||
entry = gtk_label_new ("Not available in this WebKit version");
|
||||
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
|
||||
FILLED_ADD (hbox, 1, 2, 4, 5);
|
||||
}
|
||||
label = katze_property_label (settings, "location-entry-search");
|
||||
INDENTED_ADD (label, 0, 1, 4, 5);
|
||||
INDENTED_ADD (label, 0, 1, 5, 6);
|
||||
entry = katze_property_proxy (settings, "location-entry-search", NULL);
|
||||
FILLED_ADD (entry, 1, 2, 4, 5);
|
||||
FILLED_ADD (entry, 1, 2, 5, 6);
|
||||
|
||||
// Page "Interface"
|
||||
PAGE_NEW (_("Interface"));
|
||||
|
|
Loading…
Reference in a new issue