Commit 74102bbf authored by Amrit Borah's avatar Amrit Borah
Browse files

added setting to preferences dialog

.
parent ebd1bb95
Pipeline #15733 passed with stages
in 1 minute and 33 seconds
......@@ -1059,6 +1059,29 @@ terminal_preferences_dialog_init (TerminalPreferencesDialog *dialog)
G_CALLBACK (terminal_preferences_dialog_geometry_notify), dialog);
terminal_preferences_dialog_geometry_notify (dialog);
/* next row */
row++;
label = gtk_label_new_with_mnemonic (_("Padding (Requires restart):"));
gtk_label_set_xalign (GTK_LABEL (label), 0.0f);
gtk_grid_attach (GTK_GRID (grid), label, 0, row, 1, 1);
gtk_widget_show (label);
button = gtk_spin_button_new_with_range (0, 50, 1);
g_object_bind_property (G_OBJECT (dialog->preferences), "misc-terminal-padding",
G_OBJECT (button), "value",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
gtk_widget_set_halign (button, GTK_ALIGN_START);
gtk_grid_attach (GTK_GRID (grid), button, 1, row, 1, 1);
gtk_widget_show (button);
button = gtk_button_new_with_mnemonic (_("Reset"));
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (terminal_preferences_dialog_reset_cell_scale), dialog);
gtk_widget_set_halign (button, GTK_ALIGN_START);
gtk_grid_attach (GTK_GRID (grid), button, 2, row, 1, 1);
gtk_widget_show (button);
/* section: Tabs */
terminal_preferences_dialog_new_section (&frame, &vbox, &grid, &label, &row, "Tabs");
......
......@@ -1255,7 +1255,7 @@ terminal_preferences_class_init (TerminalPreferencesClass *klass)
g_param_spec_int ("misc-terminal-padding",
NULL,
"MiscTerminalPadding",
0, 100, 10,
0, 50, 10,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
......
......@@ -89,13 +89,6 @@ const gchar *CSS_SLIM_TABS =
" padding: 1px;\n"
"}\n";
const gchar *CSS_TERMINAL_PADDING =
"VteTerminal, TerminalScreen, vte-terminal {\n"
" padding: %dpx %dpx %dpx %dpx;\n"
" -VteTerminal-inner-border: %dpx %dpx %dpx %dpx;\n"
"}\n";
/* See gnome-terminal bug #789356 */
#if GTK_CHECK_VERSION (3, 22, 23)
#define WINDOW_STATE_TILED (GDK_WINDOW_STATE_TILED | \
......@@ -530,6 +523,8 @@ terminal_window_init (TerminalWindow *window)
/* set notebook tabs style */
gtk_widget_set_name (window->priv->notebook, NOTEBOOK_NAME);
terminal_window_update_slim_tabs (window);
/* set terminal padding: Needs restart */
terminal_window_update_terminal_padding (window);
/* signals */
......@@ -999,7 +994,9 @@ terminal_window_update_terminal_padding (TerminalWindow *window)
g_object_get (G_OBJECT (window->priv->preferences),
"misc-terminal-padding", &padding,
NULL);
str = g_strdup_printf (CSS_TERMINAL_PADDING,
str = g_strdup_printf ("VteTerminal, TerminalScreen, vte-terminal {\n"
" padding: %dpx %dpx %dpx %dpx;\n"
" -VteTerminal-inner-border: %dpx %dpx %dpx %dpx;}\n",
padding, padding, padding, padding,
padding, padding, padding, padding);
provider = gtk_css_provider_new ();
......@@ -1008,6 +1005,7 @@ terminal_window_update_terminal_padding (TerminalWindow *window)
GTK_STYLE_PROVIDER_PRIORITY_USER);
gtk_css_provider_load_from_data (provider, str, -1, NULL);
g_object_unref (provider);
g_free (str);
}
......
......@@ -56,7 +56,6 @@ typedef enum
TERMINAL_WINDOW_ACTION_SELECT_ALL,
TERMINAL_WINDOW_ACTION_COPY_INPUT,
TERMINAL_WINDOW_ACTION_PREFERENCES,
TERMINAL_WINDOW_ACTION_SHORTCUTS,
TERMINAL_WINDOW_ACTION_VIEW_MENU,
TERMINAL_WINDOW_ACTION_ZOOM_IN,
TERMINAL_WINDOW_ACTION_ZOOM_IN_ALT,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment