From 35f3ce8595eb3260f78d9277dd97ec467647c75e Mon Sep 17 00:00:00 2001 From: sanette Date: Thu, 24 Dec 2020 17:32:56 +0100 Subject: [PATCH] settings dialog styling restyle settings for allowing narrow screen: issue #1328 https://github.com/xournalpp/xournalpp/issues/1328 adapt Settings dialog to smaller screens fix cbTrySelectOnStrokeFiltered width make GtkNoteBook scrollable --- src/gui/dialog/SettingsDialog.cpp | 27 ++ ui/exportSettings.glade | 1 + ui/latexSettings.glade | 15 +- ui/pageTemplate.glade | 3 +- ui/settings.glade | 639 ++++++++++++++++-------------- ui/xournalpp.css | 9 + 6 files changed, 388 insertions(+), 306 deletions(-) diff --git a/src/gui/dialog/SettingsDialog.cpp b/src/gui/dialog/SettingsDialog.cpp index af29afd2..2f982a6f 100644 --- a/src/gui/dialog/SettingsDialog.cpp +++ b/src/gui/dialog/SettingsDialog.cpp @@ -166,6 +166,33 @@ void SettingsDialog::setDpi(int dpi) { void SettingsDialog::show(GtkWindow* parent) { load(); + // detect display size. If large enough, we enlarge the Settings + // Window up to 1000x740. + GdkDisplay* disp = gdk_display_get_default(); + if (disp != NULL) { + GdkWindow* win = gtk_widget_get_window(GTK_WIDGET(parent)); + if (win != NULL) { + GdkMonitor* moni = gdk_display_get_monitor_at_window(disp, win); + GdkRectangle workarea; + gdk_monitor_get_workarea(moni, &workarea); + gint w = -1; + gint h = -1; + if (workarea.width > 1100) { + w = 1000; + } else if (workarea.width > 920) { + w = 900; + } + if (workarea.height > 800) { + h = 740; + } else if (workarea.height > 620) { + h = 600; + } + gtk_window_set_default_size(GTK_WINDOW(this->window), w, h); + } else { + g_message("Parent window does not have a GDK Window. This is unexpected."); + } + } + gtk_window_set_transient_for(GTK_WINDOW(this->window), parent); int res = gtk_dialog_run(GTK_DIALOG(this->window)); diff --git a/ui/exportSettings.glade b/ui/exportSettings.glade index a1c6129d..be70a233 100644 --- a/ui/exportSettings.glade +++ b/ui/exportSettings.glade @@ -46,6 +46,7 @@ False vertical 4 + 12 dialog-action_area2 diff --git a/ui/latexSettings.glade b/ui/latexSettings.glade index f33bd0d9..5b7585b8 100644 --- a/ui/latexSettings.glade +++ b/ui/latexSettings.glade @@ -11,8 +11,8 @@ True True - in - 500 + 450 + 500 True @@ -22,11 +22,13 @@ True False vertical + True True False - 0 + 0.01 + 12 True @@ -75,7 +77,8 @@ True False - 0 + 0.01 + 12 True @@ -107,6 +110,7 @@ True False start + True The following strings will be substituted in the global template file when running the LaTeX tool: @@ -222,7 +226,8 @@ True False - 0 + 0.01 + 12 True diff --git a/ui/pageTemplate.glade b/ui/pageTemplate.glade index 277c57ee..98cc68f6 100644 --- a/ui/pageTemplate.glade +++ b/ui/pageTemplate.glade @@ -28,6 +28,7 @@ False vertical 4 + 12 dialog-action_area2 @@ -125,7 +126,7 @@ True False center - 10 + 12 10 diff --git a/ui/settings.glade b/ui/settings.glade index a402dc5e..d7762738 100644 --- a/ui/settings.glade +++ b/ui/settings.glade @@ -200,6 +200,7 @@ True left False + True saveLoadTabBox @@ -211,8 +212,8 @@ True True - never - 500 + 450 + 500 True @@ -228,6 +229,7 @@ True False 0.009999999776482582 + 12 True @@ -248,7 +250,6 @@ If the file was not yet saved you can find it in your home directory, in ~/.xournalpp/autosave</i> True True - 85 85 0 @@ -360,6 +361,7 @@ If the file was not yet saved you can find it in your home directory, in ~/.xour True False 0.009999999776482582 + 12 True @@ -378,7 +380,6 @@ If the file was not yet saved you can find it in your home directory, in ~/.xour <i>This name will be proposed if you save a new document.</i> True True - 85 85 0 @@ -457,19 +458,19 @@ If the file was not yet saved you can find it in your home directory, in ~/.xour %H Hour in 24h format (00-23) %I Hour in 12h format (01-12) %j Day of the year (001-366) -%m Month as a decimal number (01-12) -%M Minute (00-59) +%m Month as a decimal number (01-12) +%M Minute (00-59) %p AM or PM designation (e.g. PM) %S Second (00-61) %U Week number with the first Sunday as the first day of week one (00-53) %w Weekday as a decimal number with Sunday as 0 (0-6) -%W Week number with the first Monday as the first day of week one (00-53) +%W Week number with the first Monday as the first day of week one (00-53) %x Date representation (e.g. 08/23/01) %X Time representation (e.g. 14:55:02) %y Year, last two digits (00-99) %Y Year (e.g. 2001) %Z Timezone name or abbreviation (e.g. CDT) -%% A % sign +%% A % sign 0 @@ -535,6 +536,7 @@ If the file was not yet saved you can find it in your home directory, in ~/.xour True False 0.009999999776482582 + 12 True @@ -554,7 +556,6 @@ If the file was not yet saved you can find it in your home directory, in ~/.xour <i>If you open a PDF and there is a Xournal file with the same name it will open the xoj file.</i> True True - 85 85 0 @@ -630,262 +631,289 @@ If the file was not yet saved you can find it in your home directory, in ~/.xour 5 vertical - + True - False - 0.009999999776482582 + True + 450 + 500 - + True False - 8 - 12 - 12 + none - + True False vertical - - True - False - This is an experimental feature! Use it with care. - 0 - - - False - True - 0 - - - - - True - False - - - Enable new input system (Requires restart) - cbNewInputSystem - True - True - False - Drag LEFT from start point acts like shift key is being held. -Drag UP acts as if Control key is being held. + + True + False + 0.009999999776482582 + 12 + + + True + False + 8 + 12 + 12 + + + True + False + vertical + + + True + False + This is an experimental feature! Use it with care. + 0 + + + False + True + 0 + + + + + True + False + + + Enable new input system (Requires restart) + cbNewInputSystem + True + True + False + Drag LEFT from start point acts like shift key is being held. + Drag UP acts as if Control key is being held. -Determination Radius: Radius at which modifiers will lock in until finished drawing. + Determination Radius: Radius at which modifiers will lock in until finished drawing. -<i>Useful for operating without keyboard.</i> - 0 - True - - - 0 - 0 - - - - - False - True - 1 - - - - - - - - - True - False - Experimental Input System - - - - - False - True - 0 - - - - - True - False - 0.009999999776482582 - - - True - False - 8 - 12 - 12 - - - True - False - vertical - - - True - False - <i>Assign device classes to each input device of your system. Only change these values if your devices are not correctly matched. (e.g. your pen shows up as touchscreen)</i> - True - True - 85 - 0 - - - False - True - 0 - - - - - hboxInputDeviceClasses - True - False - vertical - - - - - - False - True - 1 - - - - - - - - - True - False - Input Devices - - - - - False - True - 1 - - - - - True - False - 0.009999999776482582 - - - True - False - 8 - 12 - 12 - - - True - False - vertical - - - True - False - These settings take only effect if the experimental input system is activated - 0 - - - False - True - 0 - - - - - cbInputSystemDrawOutsideWindow - True - True - False - 0.5 - True - - - True - False - Enable drawing outside of window <i>(Drawing will not stop at the border of the window)</i> - True - True - 0 - - - - - False - True - 1 - - - - - cbInputSystemTPCButton - True - True - False - Drag LEFT from start point acts like shift key is being held. -Drag UP acts as if Control key is being held. + <i>Useful for operating without keyboard.</i> + 0 + True + + + 0 + 0 + + + + + False + True + 1 + + + + + + + + + True + False + Experimental Input System + + + + + False + True + 0 + + + + + True + False + 0.009999999776482582 + 12 + + + True + False + 8 + 12 + 12 + + + True + False + vertical + + + True + False + <i>Assign device classes to each input device of your system. Only change these values if your devices are not correctly matched. (e.g. your pen shows up as touchscreen)</i> + True + True + 85 + 0 + + + False + True + 0 + + + + + hboxInputDeviceClasses + True + False + vertical + + + + + + False + True + 1 + + + + + + + + + True + False + Input Devices + + + + + False + True + 1 + + + + + True + False + 0.009999999776482582 + 12 + + + True + False + 8 + 12 + 12 + + + True + False + vertical + + + True + False + These settings take only effect if the experimental input system is activated + 0 + + + False + True + 0 + + + + + cbInputSystemDrawOutsideWindow + True + True + False + 0.5 + True + + + True + False + Enable drawing outside of window <i>(Drawing will not stop at the border of the window)</i> + True + True + 0 + + + + + False + True + 1 + + + + + cbInputSystemTPCButton + True + True + False + Drag LEFT from start point acts like shift key is being held. + Drag UP acts as if Control key is being held. -Determination Radius: Radius at which modifiers will lock in until finished drawing. + Determination Radius: Radius at which modifiers will lock in until finished drawing. -<i>Useful for operating without keyboard.</i> - 0 - True - - - True - False - Merge button events with stylus tip events -<i>(Check this if</i> "<tt>xsetwacom get *deviceId* TabletPCButton</tt>" <i>returns</i> "<tt>on</tt>"<i>)</i> - True - True - 0 - - - - - False - True - 2 - - - - - - - - - True - False - Options - - - - - False + <i>Useful for operating without keyboard.</i> + 0 + True + + + True + False + Merge button events with stylus tip events + <i>(Check this if</i> "<tt>xsetwacom get *deviceId* TabletPCButton</tt>" <i>returns</i> "<tt>on</tt>"<i>)</i> + True + True + 0 + + + + + False + True + 2 + + + + + + + + + True + False + Options + + + + + False + True + 2 + + + + + + + + + True True - 2 - - - - - 1 - - + 0 + + + + inputTabLabel @@ -909,7 +937,6 @@ Determination Radius: Radius at which modifiers will lock in until finished draw True True - never True @@ -925,6 +952,7 @@ Determination Radius: Radius at which modifiers will lock in until finished draw True False 0.009999999776482582 + 12 True @@ -944,7 +972,6 @@ Determination Radius: Radius at which modifiers will lock in until finished draw <i>Define which tools will be selected if you press a mouse button. After you release the button the previously selected tool will be selected.</i> True True - 85 85 0 @@ -1087,8 +1114,8 @@ Determination Radius: Radius at which modifiers will lock in until finished draw True True - never - 500 + 450 + 500 True @@ -1104,6 +1131,7 @@ Determination Radius: Radius at which modifiers will lock in until finished draw True False 0.009999999776482582 + 12 True @@ -1123,7 +1151,6 @@ Determination Radius: Radius at which modifiers will lock in until finished draw <i>Pressure Sensitivity allows you to draw lines with different widths, depending on how much pressure you apply to the pen. If your tablet does not support this feature this setting has no effect.</i> True True - 85 85 0 @@ -1172,6 +1199,7 @@ Determination Radius: Radius at which modifiers will lock in until finished draw True False 0.009999999776482582 + 12 True @@ -1191,7 +1219,6 @@ Determination Radius: Radius at which modifiers will lock in until finished draw <i>With some setup, pen strokes have artifacts at their beginning. This can be avoided by ignoring the first few events/stroke-points when the pen touches the screen.</i> True True - 85 85 0 @@ -1280,6 +1307,7 @@ Determination Radius: Radius at which modifiers will lock in until finished draw True False 0.009999999776482582 + 12 True @@ -1299,7 +1327,6 @@ Determination Radius: Radius at which modifiers will lock in until finished draw <i>Specify the tools that will be selected if a button of the stylus is pressed or the eraser is used. After releasing the button, the previous tool will be selected.</i> True True - 85 85 0 @@ -1480,8 +1507,8 @@ Determination Radius: Radius at which modifiers will lock in until finished draw True True - never - 500 + 450 + 500 True @@ -1497,6 +1524,7 @@ Determination Radius: Radius at which modifiers will lock in until finished draw True False 0.009999999776482582 + 12 True @@ -1516,7 +1544,6 @@ Determination Radius: Radius at which modifiers will lock in until finished draw <i>You can configure devices, not identified by GTK as touchscreen, to behave as if they were one.</i> True True - 85 85 0 @@ -1564,6 +1591,7 @@ Determination Radius: Radius at which modifiers will lock in until finished draw True False 0.009999999776482582 + 12 True @@ -1583,7 +1611,6 @@ Determination Radius: Radius at which modifiers will lock in until finished draw <i>If your hardware does not support hand recognition, Xournal++ can disable your touchscreen when your pen is near the screen.</i> True True - 85 85 0 @@ -1724,7 +1751,6 @@ Determination Radius: Radius at which modifiers will lock in until finished draw <i>Specify commands that are called once Hand Recognition triggers. The commands will be executed in the UI Thread, make sure they are not blocking!</i> True True - 85 85 0 @@ -1868,6 +1894,7 @@ Determination Radius: Radius at which modifiers will lock in until finished draw True False 0.009999999776482582 + 12 True @@ -1933,6 +1960,7 @@ Determination Radius: Radius at which modifiers will lock in until finished draw True False 0.009999999776482582 + 12 True @@ -1953,7 +1981,6 @@ Determination Radius: Radius at which modifiers will lock in until finished draw This also enables touch drawing.</i> True True - 85 85 0 @@ -2036,8 +2063,8 @@ This also enables touch drawing.</i> True True - never - 500 + 450 + 500 True @@ -2053,6 +2080,7 @@ This also enables touch drawing.</i> True False 0.009999999776482582 + 12 True @@ -2259,6 +2287,7 @@ This also enables touch drawing.</i> True False 0.009999999776482582 + 12 True @@ -2550,6 +2579,7 @@ This also enables touch drawing.</i> True False 0.009999999776482582 + 12 True @@ -2617,6 +2647,7 @@ This also enables touch drawing.</i> True False 0.009999999776482582 + 12 True @@ -2696,6 +2727,7 @@ This also enables touch drawing.</i> True False 0.009999999776482582 + 12 True @@ -2763,6 +2795,7 @@ This also enables touch drawing.</i> True False 0.009999999776482582 + 12 True @@ -2898,8 +2931,8 @@ This also enables touch drawing.</i> True True - never - 500 + 450 + 500 True @@ -2915,6 +2948,7 @@ This also enables touch drawing.</i> True False 0.009999999776482582 + 12 True @@ -3029,6 +3063,7 @@ This also enables touch drawing.</i> True False 0.009999999776482582 + 12 True @@ -3047,7 +3082,6 @@ This also enables touch drawing.</i> False <i>To make sure on 100% zoom the size of elements is natural. (requires restart)</i> True - 85 85 0 @@ -3069,7 +3103,6 @@ This also enables touch drawing.</i> 5 <i>Put a ruler on your screen and move the slider until both rulers match.</i> True - 85 85 0 @@ -3188,8 +3221,8 @@ This also enables touch drawing.</i> True True - never - 500 + 450 + 500 True @@ -3205,6 +3238,7 @@ This also enables touch drawing.</i> True False 0.009999999776482582 + 12 True @@ -3224,7 +3258,6 @@ This also enables touch drawing.</i> <i>If you add additional space beside the pages you can choose the area of the screen you would like to work on.</i> True True - 85 85 0 @@ -3361,6 +3394,7 @@ This also enables touch drawing.</i> True False 0.009999999776482582 + 12 True @@ -3426,6 +3460,7 @@ This also enables touch drawing.</i> True False 0.009999999776482582 + 12 True @@ -3575,6 +3610,7 @@ This also enables touch drawing.</i> True False 0.009999999776482582 + 12 True @@ -3658,11 +3694,8 @@ Determination Radius: Radius at which modifiers will lock in until finished draw True False - 4 - 3 - 3 - 2 0.0099999997764825821 + 12 True @@ -3712,6 +3745,7 @@ Determination Radius: Radius at which modifiers will lock in until finished draw True False 0.009999999776482582 + 12 True @@ -3745,10 +3779,9 @@ Determination Radius: Radius at which modifiers will lock in until finished draw True False Ignore Time (ms) - 0.03 - 2 + 1 0 @@ -3768,7 +3801,7 @@ Determination Radius: Radius at which modifiers will lock in until finished draw 150 - 2 + 1 1 @@ -3789,7 +3822,7 @@ Determination Radius: Radius at which modifiers will lock in until finished draw 1 - 3 + 2 1 @@ -3800,7 +3833,7 @@ Determination Radius: Radius at which modifiers will lock in until finished draw Max Length (mm) - 3 + 2 0 @@ -3811,7 +3844,7 @@ Determination Radius: Radius at which modifiers will lock in until finished draw Successive (ms) - 4 + 3 0 @@ -3831,7 +3864,7 @@ Determination Radius: Radius at which modifiers will lock in until finished draw 500 - 4 + 3 1 @@ -3848,21 +3881,23 @@ Determination Radius: Radius at which modifiers will lock in until finished draw True - 0 - 1 + 1 + 2 + 3 True + GTK_ALIGN_END False All three conditions must be met before stroke is ignored. It must be short in time and length and we can't have ignored another stroke recently. Settings: - 1 - 0 + 0 + 1 @@ -3878,8 +3913,8 @@ It must be short in time and length and we can't have ignored another stroke rec True - 1 - 1 + 0 + 2 @@ -3891,7 +3926,6 @@ It must be short in time and length and we can't have ignored another stroke rec True False Action on Tool Tap - 0.04 @@ -3940,8 +3974,8 @@ It must be short in time and length and we can't have ignored another stroke rec True True - never - 500 + 450 + 500 True @@ -3957,6 +3991,7 @@ It must be short in time and length and we can't have ignored another stroke rec True False 0.009999999776482582 + 12 True @@ -3975,7 +4010,6 @@ It must be short in time and length and we can't have ignored another stroke rec False <i>Select the tool and Settings if you press the Default Button.</i> True - 85 85 0 @@ -4086,8 +4120,8 @@ It must be short in time and length and we can't have ignored another stroke rec True True - never - 500 + 450 + 500 True @@ -4103,6 +4137,7 @@ It must be short in time and length and we can't have ignored another stroke rec True False 0.009999999776482582 + 12 True @@ -4121,7 +4156,6 @@ It must be short in time and length and we can't have ignored another stroke rec False <i>Audio recordings are currently stored in a separate folder and referenced from the journal.</i> True - 85 85 0 @@ -4193,6 +4227,7 @@ It must be short in time and length and we can't have ignored another stroke rec True False 0.009999999776482582 + 12 True @@ -4213,7 +4248,6 @@ It must be short in time and length and we can't have ignored another stroke rec If available select <small><tt>pulse</tt></small> as input / output device.</i> True True - 85 85 0 @@ -4305,6 +4339,7 @@ If available select <small><tt>pulse</tt></small> as inp True False 0.009999999776482582 + 12 True @@ -4399,6 +4434,7 @@ If available select <small><tt>pulse</tt></small> as inp True False 0.009999999776482582 + 12 True @@ -4465,7 +4501,6 @@ If available select <small><tt>pulse</tt></small> as inp False <i>Changes take only effect on new recordings and playbacks.</i> True - 85 85 0 @@ -4507,6 +4542,7 @@ If available select <small><tt>pulse</tt></small> as inp True False + 5 vertical @@ -4537,7 +4573,6 @@ If available select <small><tt>pulse</tt></small> as inp True True - never True @@ -4553,6 +4588,10 @@ If available select <small><tt>pulse</tt></small> as inp True False 0.009999999776482582 + 4 + 3 + 3 + 2 True diff --git a/ui/xournalpp.css b/ui/xournalpp.css index a5eef027..a07fdbd6 100644 --- a/ui/xournalpp.css +++ b/ui/xournalpp.css @@ -71,3 +71,12 @@ GtkToolbar GtkButton padding: 2 } */ + + +/* +Labels for subsections of the Settings dialog +*/ +notebook frame>label{ + color: #666; + font-weight: bold; +}