Skip to content

Commit

Permalink
File chooser changes, other improvements.
Browse files Browse the repository at this point in the history
- Unneeded dependences and makedepends removed form PKGBUILD.
- REAMDE.md updated.

- Dropped support of custom stylesheet for HighContrast theme.
- Improved custom stylesheet for Adwaita theme: buttons are smaller, dotted lines in scrolled windows are hidden, file chooser looks better.

- Patch of file chooser typeahead feature improved. Now it is possible to use default GTK recursive search engine by Alt+S shortcut.
- Better patch of print dialog appearance. Now print dialog appearance exactly match to other dialogs.
- Simplification of file chooser icons patch. "-gtk-icon-style: regular" CSS property is used.
  • Loading branch information
TomaszGasior committed Aug 27, 2017
1 parent 549a5e6 commit 62f18c9
Show file tree
Hide file tree
Showing 9 changed files with 292 additions and 505 deletions.
27 changes: 13 additions & 14 deletions .SRCINFO
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
pkgbase = gtk3-mushrooms
pkgdesc = GTK3 library with my modifications (see README).
pkgver = 3.22.19
pkgrel = 1
pkgrel = 2
url = http://www.gtk.org/
arch = i686
arch = x86_64
license = LGPL
makedepends = gobject-introspection
makedepends = libcanberra
makedepends = gtk-doc
makedepends = rest
makedepends = libcups
makedepends = glib2-docs
depends = atk
depends = cairo
depends = libxcursor
Expand All @@ -28,13 +25,15 @@ pkgbase = gtk3-mushrooms
depends = at-spi2-atk
depends = wayland
depends = libxkbcommon
depends = adwaita-icon-theme
depends = json-glib
depends = librsvg
depends = wayland-protocols
depends = desktop-file-utils
depends = mesa
optdepends = gtk3-print-backends: Printing
depends = gtk-update-icon-cache
optdepends = gtk3-print-backends: printing
optdepends = adwaita-icon-theme: default icon theme
optdepends = cantarell-fonts: default font
provides = gtk3=3.22.19
conflicts = gtk3
source = csd__clean-headerbar.patch
Expand All @@ -60,30 +59,30 @@ pkgbase = gtk3-mushrooms
source = print-dialog__default-previewer.patch
source = smaller-adwaita.css
source = https://github.com/GNOME/gtk/archive/3.22.19.tar.gz
source = settings.ini::https://git.archlinux.org/svntogit/packages.git/plain/trunk/settings.ini?h=packages/gtk3&id=1842b0f5f36f64944ea8941928d77468456e432e
source = gtk-query-immodules-3.0.hook::https://git.archlinux.org/svntogit/packages.git/plain/trunk/gtk-query-immodules-3.0.hook?h=packages/gtk3&id=1842b0f5f36f64944ea8941928d77468456e432e
source = settings.ini::https://git.archlinux.org/svntogit/packages.git/plain/trunk/settings.ini?h=packages/gtk3&id=eb853c7714b8675246344169980ace3f4e18aac3
source = gtk-query-immodules-3.0.hook::https://git.archlinux.org/svntogit/packages.git/plain/trunk/gtk-query-immodules-3.0.hook?h=packages/gtk3&id=eb853c7714b8675246344169980ace3f4e18aac3
sha256sums = 7a1f4259502eea2f610df3ed8f82fc929fce1ebe92422327f54aa41ddf47e7f8
sha256sums = 58eb8466a76d6d48f32ec77365dc5436334e2aab9dd9df3ab59d5d55beb591cb
sha256sums = a97f8b588ccfd55e78bccbbfa55b3ca62d5e1732cc815852b31ba9a6fa722494
sha256sums = 831e67a278152e93561658f364a10251ed07a9d05c60828b7ec1ab933ebe67b0
sha256sums = 5f6dded28c77cfbd1c58f8c334c8544fc84093124f385f87dcf05eeb045bbd8b
sha256sums = 4d2fdb331e105c8512d3b2ad16b8c512b372fa3c3658c6881b1f89c9d78da7fb
sha256sums = 9d07b362be00fa493642f680feeebc49cfae28f8f88c0e8c6de13b15323dacc9
sha256sums = 114edc66d1453fc3dbf2314b939d135b10ad3414fd972da77c5a44534bb6c6d6
sha256sums = fdc2c3d63c0fc94934c10a99189062955e8f40acd3bb883b739faefa86344c1f
sha256sums = 769ad0e70a6ac01c203417e50f06d64dbc9fd260707abf5289642ca5a4d4e7f4
sha256sums = 6f37fcf05281642a3a41e9f9994be21905264daf64f6e59455586bc82e502473
sha256sums = e8e1a4faceff212cb9ab5d29bbf6e9f6f817cba2fcce61e7e5cd51d0f1dd33dd
sha256sums = a2af0c7f29e9ae5e2a669f4ad131acab8d5cbd5d47cc3914750db25b8eeefe1e
sha256sums = b978504d311fb87505e1787a07c246310e3389840082f326e266193ad908c0f1
sha256sums = cf1e95e4a8c9d001d919fddeab9260b39e32739fe66440138dfc70182df5297a
sha256sums = 103f86c0f03a1c210a56a44434c19b9f64f8c376bcead689a04919b26b0f4d4c
sha256sums = 7908611ae7f85a37542b1f1558f46f1d5f35fa1996551d4e61c163569ea3b0ac
sha256sums = cfacf351122f95cbef5e752f8e1850ee4ff5495d3bf43732405c2a51e02a9f24
sha256sums = 64776101101b0ddc256e32a318f35526eb5e41b48aba7b7d30c39ef76db77ace
sha256sums = 1ef8375ec4c9275e0e143a39347c931b85eaa4e393aea8ab375db759d9b8ae0f
sha256sums = e8d53849a3277fa0f0f729be2197970f28cd809070021d2f5ae1987df8250171
sha256sums = ae3da3618e294dace5a2459a9e3bfaa3bd50be034449eec2828eaa2e217ce851
sha256sums = a55a56aeb72715cb6ae39e440e01ff7492e484400f6e063368b74abf59d44fdb
sha256sums = 692b49bce7143507b5c7f176ac67266d75251088da19b282129ad11a3fab5a41
sha256sums = b479fe0a82db21475fde30d9daad4360552b67957479773a1216058c7ff46629
sha256sums = 23cdd8b8034e73bb852d42feaabf4f995983a032be479d9ce84e5858c0bd5c41
sha256sums = 0b055f7437d965601fe306631fd29f56bb12018dde005d60729e3f40e85f0824
sha256sums = 0554ba2085fb8cec8e3b926efc250ae5c15cf47f2612c10cdd0e849bfb8d05a5
sha256sums = 4b86fbb917fd6242684e815482b6c495015ae86260f8919c9cb5bcdbd25a3e3f
sha256sums = 01fc1d81dc82c4a052ac6e25bf9a04e7647267cc3017bc91f9ce3e63e5eb9202
sha256sums = de46e5514ff39a7a65e01e485e874775ab1c0ad20b8e94ada43f4a6af1370845
Expand Down
64 changes: 32 additions & 32 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# This file is based on original PKGBUILD of GTK3 package.
# https://git.archlinux.org/svntogit/packages.git/plain/trunk/PKGBUILD?h=packages/gtk3

__arch_pkg_commit="1842b0f5f36f64944ea8941928d77468456e432e"
__arch_pkg_commit="eb853c7714b8675246344169980ace3f4e18aac3"

pkgname=gtk3-mushrooms
pkgver=3.22.19
pkgrel=1
pkgrel=2
pkgdesc="GTK3 library with my modifications (see README)."
url="http://www.gtk.org/"
conflicts=(gtk3)
Expand All @@ -17,13 +17,15 @@ license=(LGPL)
depends=(
atk cairo libxcursor libxinerama libxrandr libxi libepoxy gdk-pixbuf2 dconf
libxcomposite libxdamage pango shared-mime-info at-spi2-atk wayland libxkbcommon
adwaita-icon-theme json-glib librsvg wayland-protocols desktop-file-utils mesa
json-glib librsvg wayland-protocols desktop-file-utils mesa gtk-update-icon-cache
)
optdepends=(
'gtk3-print-backends: Printing'
'gtk3-print-backends: printing'
'adwaita-icon-theme: default icon theme'
'cantarell-fonts: default font'
)
makedepends=(
gobject-introspection libcanberra gtk-doc rest libcups glib2-docs
gobject-introspection libcanberra gtk-doc
)
source=(
# Patch files.
Expand All @@ -49,7 +51,7 @@ source=(
"print-dialog__appearance.patch"
"print-dialog__default-previewer.patch"

# Themes CSS file.
# Theme CSS stylesheet.
"smaller-adwaita.css"

# GTK source code from GitHub.
Expand All @@ -61,30 +63,30 @@ source=(
)
sha256sums=(
# Patch files.
"7a1f4259502eea2f610df3ed8f82fc929fce1ebe92422327f54aa41ddf47e7f8"
"58eb8466a76d6d48f32ec77365dc5436334e2aab9dd9df3ab59d5d55beb591cb"
"a97f8b588ccfd55e78bccbbfa55b3ca62d5e1732cc815852b31ba9a6fa722494"
"831e67a278152e93561658f364a10251ed07a9d05c60828b7ec1ab933ebe67b0"
"5f6dded28c77cfbd1c58f8c334c8544fc84093124f385f87dcf05eeb045bbd8b"
"4d2fdb331e105c8512d3b2ad16b8c512b372fa3c3658c6881b1f89c9d78da7fb"
"9d07b362be00fa493642f680feeebc49cfae28f8f88c0e8c6de13b15323dacc9"
"114edc66d1453fc3dbf2314b939d135b10ad3414fd972da77c5a44534bb6c6d6"
"769ad0e70a6ac01c203417e50f06d64dbc9fd260707abf5289642ca5a4d4e7f4"
"6f37fcf05281642a3a41e9f9994be21905264daf64f6e59455586bc82e502473"
"e8e1a4faceff212cb9ab5d29bbf6e9f6f817cba2fcce61e7e5cd51d0f1dd33dd"
"cf1e95e4a8c9d001d919fddeab9260b39e32739fe66440138dfc70182df5297a"
"103f86c0f03a1c210a56a44434c19b9f64f8c376bcead689a04919b26b0f4d4c"
"7908611ae7f85a37542b1f1558f46f1d5f35fa1996551d4e61c163569ea3b0ac"
"cfacf351122f95cbef5e752f8e1850ee4ff5495d3bf43732405c2a51e02a9f24"
"64776101101b0ddc256e32a318f35526eb5e41b48aba7b7d30c39ef76db77ace"
"1ef8375ec4c9275e0e143a39347c931b85eaa4e393aea8ab375db759d9b8ae0f"
"ae3da3618e294dace5a2459a9e3bfaa3bd50be034449eec2828eaa2e217ce851"
"a55a56aeb72715cb6ae39e440e01ff7492e484400f6e063368b74abf59d44fdb"
"692b49bce7143507b5c7f176ac67266d75251088da19b282129ad11a3fab5a41"
"23cdd8b8034e73bb852d42feaabf4f995983a032be479d9ce84e5858c0bd5c41"

# Themes CSS file.
"0b055f7437d965601fe306631fd29f56bb12018dde005d60729e3f40e85f0824"
"7a1f4259502eea2f610df3ed8f82fc929fce1ebe92422327f54aa41ddf47e7f8"
"58eb8466a76d6d48f32ec77365dc5436334e2aab9dd9df3ab59d5d55beb591cb"
"a97f8b588ccfd55e78bccbbfa55b3ca62d5e1732cc815852b31ba9a6fa722494"
"831e67a278152e93561658f364a10251ed07a9d05c60828b7ec1ab933ebe67b0"
"5f6dded28c77cfbd1c58f8c334c8544fc84093124f385f87dcf05eeb045bbd8b"
"4d2fdb331e105c8512d3b2ad16b8c512b372fa3c3658c6881b1f89c9d78da7fb"
"9d07b362be00fa493642f680feeebc49cfae28f8f88c0e8c6de13b15323dacc9"
"fdc2c3d63c0fc94934c10a99189062955e8f40acd3bb883b739faefa86344c1f"
"769ad0e70a6ac01c203417e50f06d64dbc9fd260707abf5289642ca5a4d4e7f4"
"a2af0c7f29e9ae5e2a669f4ad131acab8d5cbd5d47cc3914750db25b8eeefe1e"
"b978504d311fb87505e1787a07c246310e3389840082f326e266193ad908c0f1"
"cf1e95e4a8c9d001d919fddeab9260b39e32739fe66440138dfc70182df5297a"
"103f86c0f03a1c210a56a44434c19b9f64f8c376bcead689a04919b26b0f4d4c"
"7908611ae7f85a37542b1f1558f46f1d5f35fa1996551d4e61c163569ea3b0ac"
"cfacf351122f95cbef5e752f8e1850ee4ff5495d3bf43732405c2a51e02a9f24"
"64776101101b0ddc256e32a318f35526eb5e41b48aba7b7d30c39ef76db77ace"
"e8d53849a3277fa0f0f729be2197970f28cd809070021d2f5ae1987df8250171"
"ae3da3618e294dace5a2459a9e3bfaa3bd50be034449eec2828eaa2e217ce851"
"a55a56aeb72715cb6ae39e440e01ff7492e484400f6e063368b74abf59d44fdb"
"b479fe0a82db21475fde30d9daad4360552b67957479773a1216058c7ff46629"
"23cdd8b8034e73bb852d42feaabf4f995983a032be479d9ce84e5858c0bd5c41"

# Theme CSS stylesheet.
"0554ba2085fb8cec8e3b926efc250ae5c15cf47f2612c10cdd0e849bfb8d05a5"

# GTK source code from GitHub.
"4b86fbb917fd6242684e815482b6c495015ae86260f8919c9cb5bcdbd25a3e3f"
Expand Down Expand Up @@ -131,8 +133,6 @@ __patch_gtk_code()

cat "$srcdir/smaller-adwaita.css" >> "gtk/theme/Adwaita/gtk-contained.css"
cat "$srcdir/smaller-adwaita.css" >> "gtk/theme/Adwaita/gtk-contained-dark.css"
cat "$srcdir/smaller-adwaita.css" >> "gtk/theme/HighContrast/gtk-contained.css"
cat "$srcdir/smaller-adwaita.css" >> "gtk/theme/HighContrast/gtk-contained-inverse.css"
}

prepare()
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Client Side Decorations
* CSDs are totally disabled by default. All windows are decorated only by window manager. You can enable CSDs by setting `GTK_CSD=0` environment variable (or `GTK_CSD=1` to force CSDs on each GTK3 window).
* Client side shadows of windows, menus and tooltips are disabled by default. You can enable shadows by setting `GTK_CSD=1` environment variable.
* Window title and subtitle are removed from headerbar. Subtitle is added to native titlebar.
* Minimize, maximize and close buttons are removed. Application menu button has changed icon.
* Minimize, maximize and close buttons are removed from headerbar. Application menu button has changed icon.

File chooser
---

* Annoying single-click "feature" in file list is disabled. You always have to double-click to choose file from list. See https://bugzilla.gnome.org/show_bug.cgi?id=758065.
* Typeahead feature is restored. Recursive file search will not be ran when you start typing. See https://bugzilla.gnome.org/show_bug.cgi?id=784029.
* Typeahead feature is restored. Recursive file search will not be ran automatically when you start typing. You can still search recursively by Left Alt + S shortcut. See https://bugzilla.gnome.org/show_bug.cgi?id=784029.
* Current working directory is opened by default instead of section with recently used files.
* "Other locations" button is removed from places sidebar. All mounted devices and drives are accessible directly.
* File system button in places sidebar is labeled as "File System" instead of "Computer".
Expand All @@ -32,9 +32,9 @@ Print dialog
Icons
---

* Some of GTK stock icons on buttons are restored. You can see it in GTK internal dialogs and in some applications.
* Some GTK stock icons on buttons are restored. You can see it in GTK internal dialogs and in some applications.
* Context menus of text fields, links and labels have restored icons too.
* Colorized icons instead of symbolic icons are used in file chooser dialog.
* Regular colorized icons instead of symbolic icons are used in file chooser dialog.

Popovers
---
Expand All @@ -50,11 +50,12 @@ Others
* Delay before showing mnemonics is removed. You don't have to wait when you press Left Alt button.
* Integration with Accessibility Toolkit is disabled by default to avoid errors in console output. See https://unix.stackexchange.com/questions/230238. **Important: if you are using assistive technologies (such as Orca reader) you must restore default GTK behavior by setting `NO_AT_BRIDGE=0` environment variable.**

Themes
Adwaita theme
---

* Default Adwaita theme and its dark variant have smaller controls (buttons, fields, tabs, etc.).
* HighContrast themes also have reduced controls (testing).
* Default Adwaita theme have smaller controls (buttons, fields, tabs, etc.).
* Message dialogs have more natural appearance.
* Dashed lines on edges of scrolled boxes are removed. See https://wiki.archlinux.org/index.php/GTK+#Disable_overlay_scrollbars.

--------

Expand Down
100 changes: 54 additions & 46 deletions file-chooser__typeahead.patch
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
diff -U 5 -r -Z -B ./org/gtk/gtkfilechooserdialog.c ./mod/gtk/gtkfilechooserdialog.c
--- ./org/gtk/gtkfilechooserdialog.c 2017-07-19 04:55:39.000000000 +0200
+++ ./mod/gtk/gtkfilechooserdialog.c 2017-07-30 13:23:41.280123562 +0200
@@ -479,11 +479,11 @@
return;

dialog->priv->search_setup = TRUE;

g_object_get (dialog, "use-header-bar", &use_header, NULL);
- if (use_header)
+ if (FALSE && use_header)
{
GtkWidget *button;
GtkWidget *image;
GtkWidget *header;

diff -U 5 -r -Z -B ./org/gtk/gtkfilechooserwidget.c ./mod/gtk/gtkfilechooserwidget.c
--- ./org/gtk/gtkfilechooserwidget.c 2017-07-19 04:55:39.000000000 +0200
+++ ./mod/gtk/gtkfilechooserwidget.c 2017-07-30 13:24:45.543460079 +0200
--- ./org/gtk/gtkfilechooserwidget.c 2017-08-22 14:33:11.000000000 +0200
+++ ./mod/gtk/gtkfilechooserwidget.c 2017-08-25 00:23:59.644034148 +0200
@@ -1399,11 +1399,11 @@
{
location_popup_handler (impl, event->string);
return TRUE;
}
}
- else if (gtk_search_entry_handle_event (GTK_SEARCH_ENTRY (priv->search_entry), (GdkEvent *)event))
+ else if (FALSE && gtk_search_entry_handle_event (GTK_SEARCH_ENTRY (priv->search_entry), (GdkEvent *)event))
{
if (priv->operation_mode != OPERATION_MODE_SEARCH)
operation_mode_set (impl, OPERATION_MODE_SEARCH);
return TRUE;
}
@@ -2476,11 +2476,11 @@
static void
file_list_set_sort_column_ids (GtkFileChooserWidget *impl)
Expand All @@ -30,20 +27,20 @@ diff -U 5 -r -Z -B ./org/gtk/gtkfilechooserwidget.c ./mod/gtk/gtkfilechooserwidg
gtk_tree_view_column_set_sort_column_id (priv->list_time_column, MODEL_COL_TIME);
gtk_tree_view_column_set_sort_column_id (priv->list_size_column, MODEL_COL_SIZE);
gtk_tree_view_column_set_sort_column_id (priv->list_location_column, MODEL_COL_LOCATION_TEXT);
@@ -3246,10 +3246,12 @@
case OPERATION_MODE_BROWSE:
operation_mode_set_browse (impl);
break;
@@ -7152,12 +7152,10 @@
{
GList *l, *files, *files_with_info, *infos;
GFile *file;
gboolean select = FALSE;

case OPERATION_MODE_SEARCH:
+ priv->operation_mode = old_mode;
+ return;
operation_mode_set_search (impl);
break;
- if (gtk_tree_model_iter_n_children (GTK_TREE_MODEL (impl->priv->search_model), NULL) == 0)
- select = TRUE;

case OPERATION_MODE_RECENT:
operation_mode_set_recent (impl);
@@ -7496,11 +7498,11 @@
files = NULL;
files_with_info = NULL;
infos = NULL;
for (l = hits; l; l = l->next)
@@ -7496,11 +7494,11 @@
GtkFileChooserWidget *impl = load_data->impl;
GtkFileChooserWidgetPrivate *priv = impl->priv;

Expand All @@ -56,19 +53,30 @@ diff -U 5 -r -Z -B ./org/gtk/gtkfilechooserwidget.c ./mod/gtk/gtkfilechooserwidg
gtk_tree_view_column_set_sort_column_id (priv->list_time_column, -1);
gtk_tree_view_column_set_sort_column_id (priv->list_size_column, -1);
gtk_tree_view_column_set_sort_column_id (priv->list_location_column, -1);
diff -U 5 -r -Z -B ./org/gtk/ui/gtkfilechooserwidget.ui ./mod/gtk/ui/gtkfilechooserwidget.ui
--- ./org/gtk/ui/gtkfilechooserwidget.ui 2017-07-19 04:55:39.000000000 +0200
+++ ./mod/gtk/ui/gtkfilechooserwidget.ui 2017-07-30 13:25:38.093462683 +0200
@@ -160,11 +160,11 @@
<property name="hscrollbar-policy">never</property>
<child>
<object class="GtkTreeView" id="browse_files_tree_view">
<property name="visible">1</property>
<property name="has-tooltip">1</property>
- <property name="enable-search">0</property>
+ <property name="enable-search">1</property>
<child internal-child="accessible">
<object class="AtkObject" id="browse_files_tree_view-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Files</property>
</object>
</child>
@@ -8422,14 +8420,10 @@
gtk_binding_entry_add_signal (binding_set,
GDK_KEY_s, GDK_MOD1_MASK,
"search-shortcut",
0);
gtk_binding_entry_add_signal (binding_set,
- GDK_KEY_f, GDK_CONTROL_MASK,
- "search-shortcut",
- 0);
- gtk_binding_entry_add_signal (binding_set,
GDK_KEY_r, GDK_MOD1_MASK,
"recent-shortcut",
0);
gtk_binding_entry_add_signal (binding_set,
GDK_KEY_p, GDK_MOD1_MASK,
@@ -8543,10 +8537,11 @@
/* Some qdata, qdata can't be set with GtkBuilder */
g_object_set_data (G_OBJECT (impl->priv->browse_files_tree_view), "fmq-name", "file_list");
g_object_set_data (G_OBJECT (impl->priv->browse_files_tree_view), I_("GtkFileChooserWidget"), impl);

/* Setup file list treeview */
+ gtk_tree_view_set_enable_search (GTK_TREE_VIEW (impl->priv->browse_files_tree_view), TRUE);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (impl->priv->browse_files_tree_view));
gtk_tree_selection_set_select_function (selection,
list_select_func,
impl, NULL);
gtk_tree_view_enable_model_drag_source (GTK_TREE_VIEW (impl->priv->browse_files_tree_view),
Loading

0 comments on commit 62f18c9

Please sign in to comment.