Commit Graph

23683 Commits

Author SHA1 Message Date
Matthias Clasen
530d295a2e Fix up some whitespace mishap 2015-07-04 22:38:30 -04:00
Matthias Clasen
8379ef3067 file chooser: Redo the trailing space warning
Redo this slightly differently, so we can keep all the simple
checks in one place. This will make it easier to reuse the code
for file renaming.
2015-07-04 22:38:30 -04:00
Matthias Clasen
8b90c79037 places sidebar: Fix memory handling of rename popover
We were freeing the same string twice here, leading to
badness.
2015-07-04 22:38:29 -04:00
Arc Riley
94bcdd3217 Strip leading and trailing whitespace from filechooser save filenames
This makes a local copy of the file part of the entry to strip it transparently
Since this is assumed to be a mistake, the user is not notified.

https://bugzilla.gnome.org/show_bug.cgi?id=593372
2015-07-04 19:21:45 -04:00
Arc Riley
02b5ac9ee4 Warn for whitespace at beginning or end of new folder names
The warning is not intended to disable the Create button and must only be shown
when the folder is not found, so this is implemented in the folder name exists
callback.

A "name" entry was added to FileExistsData to pass the filename to the callback

https://bugzilla.gnome.org/show_bug.cgi?id=751800
2015-07-04 18:57:13 -04:00
Emmanuele Bassi
d2569a3860 docs: Drop deprecated symbolic icon names
Do not suggest using icons that do not exist.
2015-07-04 19:34:23 +01:00
Emmanuele Bassi
c5a250ce37 container: Update the add() warning
Now that gtk_widget_reparent() has been deprecated, we should not
suggest it.
2015-07-04 19:34:23 +01:00
Matthias Clasen
309c845e69 file chooser: Make Ctrl-L work in search mode
There is no real reason to not allow this. The transition is
not quite as smooth as it should be, currently, but at least
it works.
2015-07-04 00:29:27 -04:00
Matthias Clasen
a453212591 file chooser dialog: Make button not take focus
Things work smoother, keynav-wise, if the search button does not
take focus on click.
2015-07-04 00:29:27 -04:00
Matthias Clasen
4dafcf9c8b file chooser: Make unsetting save entry work
Fix an overzealous assertion.
2015-07-04 00:29:27 -04:00
Matthias Clasen
017025c1a7 file chooser dialog: Make action changes work
We were not listening for action changes to update the
save entry.
2015-07-04 00:29:26 -04:00
Matthias Clasen
bb6f698abe file chooser: Cleanups 2015-07-04 00:29:26 -04:00
Matthias Clasen
29abbdd3e3 file chooser: Don't show Trash in save mode
You can't save there...
2015-07-04 00:29:26 -04:00
Matthias Clasen
78db92df7e GtkPlacesSidebar: Allow hiding Trash
We will use this in the filechooser in save mode.
2015-07-04 00:29:26 -04:00
Matthias Clasen
fa3ff773be GtkTreeViewColumn: Fix a documentation typo 2015-07-04 00:29:26 -04:00
Matthias Clasen
22294a4a0d file chooser: Improve column sizing
Allow the name and location columns to be resized, but arrange
for their sizing to be reset when the column layout changes (either
by the location column appearing/disappearing, or by the time
column changing between mtime and atime. This gives a decent
compromise between good automatic sizing and user control.
2015-07-04 00:29:26 -04:00
Matthias Clasen
ed1c349e0b file chooser: Remove a wrong assumption
The code for getting the selected files was assuming that
we are always in browse mode, and was causing warnings when
hitting Ctrl-L twice, right after opening the file chooser.

The fix is to simple use the model that is passed into the
callback.
2015-07-04 00:29:26 -04:00
Matthias Clasen
17a860cea2 file chooser: Don't show Enter Location in sidebar
Following the file chooser mockups.
2015-07-04 00:29:26 -04:00
Matthias Clasen
c7bc902093 file chooser: Update empty state for search
Follow the mockups more.
2015-07-04 00:29:26 -04:00
Matthias Clasen
191bccebf3 file chooser: Add search progress
Show a spinner if no search reasults have shown up yet and
the search is still going, after 2 seconds.
2015-07-04 00:29:26 -04:00
Matthias Clasen
31a022175f file chooser: Set fixed sort functions for recent and search 2015-07-04 00:29:26 -04:00
Matthias Clasen
0ac17418dd file chooser: Improve location column formatting 2015-07-04 00:29:26 -04:00
Matthias Clasen
39c2d12330 file chooser: Improve the mode switching operation
Avoid reloading models unnecessarily, e.g. when the user
switches to search and back without starting a search.
Keep the current list contents visible until a search is
actually started. Also, synchronize any changes in the
column layout with the corresponding model changes.
2015-07-04 00:29:26 -04:00
Matthias Clasen
9a44467318 Add a getter for the directory to file system model
This will allow us to aovid reloading if the directory is
unchanged.
2015-07-04 00:29:26 -04:00
Matthias Clasen
5763199e43 file chooser: Clean up enum handling
Use g_settings_get_set_enum to handle the clock and date format
settings.
2015-07-04 00:29:25 -04:00
Matthias Clasen
f690167b0d file chooser: Code cleanups
Shorten excessively long field names.
2015-07-04 00:29:25 -04:00
Matthias Clasen
443601addc file chooser: Consistently clear model caches
This was not done for all models in all places, leading to e.g.
icon theme updates not applying correctly to search results.
2015-07-04 00:29:25 -04:00
Matthias Clasen
2cd6d1a351 file chooser: Add a way to toggle time display 2015-07-04 00:29:25 -04:00
Matthias Clasen
215a9a1b08 file chooser: remove a stale comment 2015-07-04 00:29:25 -04:00
Matthias Clasen
8974ec7413 file chooser: Improve time and date formatting
Use the same formats as nautilus, and put date and time in
separate cells, so they are neatly aligned.
2015-07-04 00:29:25 -04:00
Matthias Clasen
1c82a533ed file chooser: Don't allow resorting recent files
They are inherently sorted by access time.
2015-07-04 00:29:25 -04:00
Matthias Clasen
412e33da16 file chooser: Use access time for recent files
Use access time for sorting the recent files, and show it in
the list instead of mtime.
2015-07-04 00:29:25 -04:00
Matthias Clasen
33b5c26f41 file chooser: Add and use a model search engine
This search engine reuses the GFileInfo that is already loaded
for the file list, to ensure that hits from the current directory
always appear promptly.
2015-07-04 00:29:25 -04:00
Matthias Clasen
fe128b5b4d file chooser: Don't show recent in save mode
Don't show Recent in the sidebar when we are in save mode.
We also ignore the startup-mode = recent in save mode now - we
don't want to populate the file list with recent files if Recent
is not on the sidebar. If you really want to go there, you can
still enter recent:// in the location entry.

https://bugzilla.gnome.org/show_bug.cgi?id=751653
2015-07-04 00:29:25 -04:00
Matthias Clasen
648e4a7ea9 file chooser: Add Ctrl-F as search shortcut
This is what nautilus uses, and is more discoverable than the
somewhat easter-egg Alt-S, which is still supported.
2015-07-04 00:29:25 -04:00
Matthias Clasen
5bc88bdc67 file chooser: Make search shortcut toggle
This is more in line with having a toggle button for search,
and it matches what we do e.g. in nautilus.
2015-07-04 00:29:25 -04:00
Matthias Clasen
75411efa48 file chooser: Tweak bindings in save mode
In save modes, the entry is really more for entering a name than
entering a full location, so don't go there eagerly when '.', '/'
or '~' are pressed. Make Ctrl-L work better in this mode too.
2015-07-04 00:29:25 -04:00
Matthias Clasen
1c3ccb39c7 file chooser: Trigger location entry not just from file list
Use the same code that brings up the location entry on '/',
'~' or '.' also when the focus is not on the file list. This
prevents those key presses on the sidebar from ending up in
the search entry.
2015-07-04 00:29:25 -04:00
Matthias Clasen
5825965027 file chooser: Open location entry on '.'
Typing ./ is a fairly common practice to enter a location
relative to the cwd, so make this open the location entry.
2015-07-04 00:29:25 -04:00
Matthias Clasen
a3470521ae Revert "file chooser: Open location entry more easily"
This reverts commit e6c1cbc88e.
2015-07-04 00:29:24 -04:00
Matthias Clasen
c0afb891c8 Revert "file chooser: Don't start search too eagerly"
This reverts commit f126157bfa.
2015-07-04 00:29:24 -04:00
Matthias Clasen
1883c5fb28 file chooser: Improve keynav
Some internal containers were erroneously taking focus, interrupting
the flow of tab keynav, and using arrow keynav to go from the file
list to the sidebar did not work anymore, after the recent sidebar
rewrite.
2015-07-04 00:29:24 -04:00
Matthias Clasen
710d193f91 file chooser: Give the location column more space
Giving it 15 characters makes it at least fit "Documents" without
ellipsizing.
2015-07-04 00:29:24 -04:00
Matthias Clasen
356f507059 file chooser: Sort search results better
Set a default sort function that sorts results from the
current folder first.
2015-07-04 00:29:24 -04:00
Matthias Clasen
9b5e00b3c4 file chooser entry: Capture Escape and emit :hide-entry
Make the file chooser entry optionally capture Escape
and emit a signal. Make the file chooser widget hide the
entry on that signal and go back to the path bar.
This gives us a two-level undo:
location entry -> path bar -> dialog close.
When the location entry is permanently displayed in the
header for save mode, we still let the first Escape close
the dialog.
2015-07-04 00:29:24 -04:00
Matthias Clasen
e0b81faade file chooser: Make Escape work in search entry
Arrange things so that hitting Escape during a running
search stops the search, but leaves the search results
around, and hitting Escape again leaves the search mode.
2015-07-04 00:29:24 -04:00
Matthias Clasen
0f9b87cfeb file chooser: Make location column work better
The location column did not work for search results in recent://.
Fix that by looking at the target uri in this case. Show the location
column in recent mode. And make it more similar to nautilus by
showing the full path if it is not below $HOME.
2015-07-04 00:29:24 -04:00
Matthias Clasen
f968199b02 file chooser: Make search in recent work
All that was needed here was to set the query location.
2015-07-04 00:29:24 -04:00
Matthias Clasen
0b11d8c115 file chooser dialog: Put save entry into header
When we have a header bar, put a save entry there and
make the file chooser use it.
2015-07-04 00:29:24 -04:00
Matthias Clasen
4f3f61bf5f file chooser widget: Allow external save entry
Prepare the file chooser to use an external entry in
save mode, instead of the builtin one.
2015-07-04 00:29:24 -04:00
Matthias Clasen
140a157d47 file chooser: Update sidsebar when entry goes away 2015-07-04 00:29:24 -04:00
Matthias Clasen
6516437353 file chooser: Use icon for create folder button
This follows the latest mockups.
2015-07-04 00:29:24 -04:00
Matthias Clasen
e9e4ed5f7f file chooser dialog: Show a subtitle
Use the new "subtitle" property of the file chooser widget
to display a subtitle in the headerbar, if we have one.
2015-07-04 00:29:24 -04:00
Matthias Clasen
10f5076bb5 file chooser widget: Expose a "subtitle" property
Give the file chooser widget a "subtitle" property, which
contains a short string that explains the current mode.
2015-07-04 00:29:24 -04:00
Matthias Clasen
715aba650e places sidebar: Add private api to get title
The places sidebar already does all the work to determine the
right label to use for the current location of the filechooser.
We want to use the same label in the headerbar subtitle, so
add some private API to get it.
2015-07-04 00:29:24 -04:00
Matthias Clasen
7e45b09c8e file chooser: More search rework
Drop the radio buttons for current location vs everywhere, and
always search in the current location.
2015-07-04 00:29:23 -04:00
Georges Basile Stavracas Neto
1f96f351e0 entrycompletion: no need to return boolean
The boolean _gtk_entry_completion_resize_popup's return
value is not used anywhere, and only adds more complexity
for the method.

https://bugzilla.gnome.org/show_bug.cgi?id=751913
2015-07-03 15:51:06 -03:00
Olivier Fourdan
c806f9b709 ignore size inc when maximized/fullscreen
Under Wayland, fullscreen/maximized windows may not cover the entire
area when a size increment is specified.

Ignore size increments for fullscreen/maximized windows just like most
window managers do under X11 so that windows with size increments can
still be fullscreen or fully maximized under Wayland as well.

https://bugzilla.gnome.org/show_bug.cgi?id=751368
2015-07-03 16:21:13 +02:00
Víctor Manuel Jáquez Leal
b3166b745f drawingarea: checks parent's draw() before call it
commit 6786c9d7 introduced a bug when a drawing area is used for
rendering videos, since GtkWidgetClass doesn't set a draw()
method by itself.

https://bugzilla.gnome.org/show_bug.cgi?id=751877
2015-07-03 14:21:30 +01:00
Matthias Clasen
28e1ed4f2a Fix warnings in the font options code
This code gets called before a screen is set.
2015-07-01 23:36:29 -07:00
Matthias Clasen
a0e8d8db0b Improve the font options support
Instead of just overwriting the default options, merge the per-widget
font options with the defaults.

https://bugzilla.gnome.org/show_bug.cgi?id=751811
2015-07-01 19:15:56 -07:00
Matthias Clasen
1be338fd44 GtkSwitch: fix a reentry issue
The introduction of state broke some users which relied on
being able to set active in a notify::active handler.

https://bugzilla.gnome.org/show_bug.cgi?id=751754
2015-07-01 18:04:56 -07:00
Jasper St. Pierre
862e0dab03 gtkwindow: Reset maximize / fullscreen_initially on state changes
Since 740bcf5, we use these properties to properly compute shadow widths
for unmapped windows. If a client calls gtk_window_maximize and a window
manager unmaximizes a window, we should draw borders, so we need to
reset these when we get the property notification.
2015-07-01 17:50:23 -07:00
Cosimo Cecchi
e67b4874eb window: don't override background every style_updated()
This queues an unnecessary resize on the toplevel, and is not needed
anymore, now that GtkWidget does not call
gtk_style_context_set_background() on the window's GdkWindow anymore.
2015-07-01 16:09:23 -07:00
Cosimo Cecchi
a1e80d99d2 stylecontext: deprecate gtk_style_context_set_background()
Nothing in GTK calls it anymore.
2015-07-01 16:09:23 -07:00
Cosimo Cecchi
d6b8261622 widget: don't call gtk_style_context_set_background()
We don't need to do this here anymore, since widgets typically render
their backgrounds now.
2015-07-01 16:09:23 -07:00
Cosimo Cecchi
a9b45e7c3c layout: add a comment for gtk_style_context_set_background()
And wrap it with G_GNUC_IGNORE_DEPRECATIONS.
Unfortunately we can't stop rendering the background altogether here.
Also, refactor some common code in a single function.
2015-07-01 16:09:23 -07:00
Cosimo Cecchi
380ebbf76d fixed: add a comment for gtk_style_context_set_background()
And wrap it with G_GNUC_IGNORE_DEPRECATIONS.
Unfortunately we can't stop rendering the background altogether here.
Also, gtk_style_context_set_background() should really be called every
time the style is updated. Fix that.
2015-07-01 16:09:23 -07:00
Cosimo Cecchi
74f2d9448f window: don't call gtk_style_context_set_background() 2015-07-01 16:09:23 -07:00
Cosimo Cecchi
8832648846 socket: don't call gtk_style_context_set_background() 2015-07-01 16:09:23 -07:00
Cosimo Cecchi
06b943fec9 toolitemgroup: don't use gtk_style_context_set_background() 2015-07-01 16:09:23 -07:00
Cosimo Cecchi
e6f97f10dd textview: don't call gtk_style_context_set_background() 2015-07-01 16:09:23 -07:00
Cosimo Cecchi
f89c86df52 revealer: don't call gtk_style_context_set_background() 2015-07-01 16:09:23 -07:00
Cosimo Cecchi
6b0f202bf3 toolpalette: don't call gtk_style_context_set_background() 2015-07-01 16:09:23 -07:00
Cosimo Cecchi
d4ecdbd300 viewport: don't call gtk_style_context_set_background() 2015-07-01 16:09:23 -07:00
Cosimo Cecchi
15908cfdf9 treeview: don't call gtk_style_context_set_background() 2015-07-01 16:09:23 -07:00
Cosimo Cecchi
18be2d697c plug: don't call gtk_style_context_set_background() 2015-07-01 16:09:23 -07:00
Cosimo Cecchi
b4ee73a291 paned: don't call gtk_style_context_set_background() 2015-07-01 16:09:23 -07:00
Cosimo Cecchi
9230143bbf overlay: don't call gtk_style_context_set_background() 2015-07-01 16:09:22 -07:00
Cosimo Cecchi
aab3d4679f offscreenwindow: don't call gtk_style_context_set_background() 2015-07-01 16:09:22 -07:00
Cosimo Cecchi
b7be29390f menushell: don't call gtk_style_context_set_background() 2015-07-01 16:09:22 -07:00
Cosimo Cecchi
828db3eca9 menu: don't call gtk_style_context_set_background() 2015-07-01 16:09:22 -07:00
Cosimo Cecchi
db76eae41a listbox: don't call gtk_style_context_set_background() 2015-07-01 16:09:22 -07:00
Cosimo Cecchi
ba2f479aa0 iconview: don't call gtk_style_context_set_background() 2015-07-01 16:09:22 -07:00
Cosimo Cecchi
9696d1b4bb flowbox: don't set gtk_style_context_set_background() 2015-07-01 16:09:22 -07:00
Cosimo Cecchi
1c9468c81b eventbox: don't call gtk_style_context_set_background() 2015-07-01 16:09:22 -07:00
Cosimo Cecchi
6786c9d724 drawingarea: don't call gtk_style_context_set_background() 2015-07-01 16:09:22 -07:00
Carlos Garnacho
8c9e426dc5 placessidebar: Do not set as a "track motion" DnD site
It has the unintended effect of picking the suggested action from the
context, which conflicts with the (possibly 0) status we set on our
::drag-motion handler.

Given this widget is not interested in listening to DnD from every
possible target, it is safe to just disable it.
2015-07-01 19:37:42 +02:00
Christoph Reiter
5d17b0af54 GtkWindow: don't increase the preferred size for empty windows if there is a size request set.
This fixes a reftest broken by commit 84e99b20ac

https://bugzilla.gnome.org/show_bug.cgi?id=751341
2015-07-01 09:32:19 -07:00
Arc Riley
15c73a2b1a Add gtk_widget_set_font_options and gtk_widget_get_font_options
This allows a widget to override global font_options, such as hinting and
subpixel order. The widget's PangoContext is updated when this is set.

Some update code from gtk_widget_update_pango_context was moved to
update_pango_context so that gtk_widget_update_pango_context runs it.

http://bugzilla.gnome.org/show_bug.cgi?id=751677
2015-07-01 07:34:32 -07:00
Cosimo Cecchi
9913b02e3b switch: add a style property for the switch height
Instead of hardcoding an aspect ratio.
This will be replaced by min-height/max-height when we have them.

https://bugzilla.gnome.org/show_bug.cgi?id=751689
2015-06-30 13:28:26 -07:00
Jasper St. Pierre
04e727709d window: Don't send startup notifications for offscreen / popup windows
The WM isn't aware of O-R (popup) or offscreen windows. If somebody
maps an offscreen or a popup GTK+ window before the main window, we'll
complete the sequence before a "real" window is mapped. Make sure to
ignore these for startup notifies.
2015-06-29 14:26:45 -07:00
nick
802b006b37 settings: Include pangofc-fontmap.h header on Wayland
In case the X11 backend is not enabled, we still need to include the
pangofc-fontmap.h header file, as we use the Pango/FontConfig API in
both the X11 and Wayland case.

https://bugzilla.gnome.org/show_bug.cgi?id=751625
2015-06-29 20:41:04 +01:00
Benjamin Otte
cd3f24d579 cssvalue: Change color transitions to run premultiplied
Previously, the unpremultiplied values from the GdkRGBA were taken. Now
we premultiply the color values as specified by the CSS specs.
This is only relevant when transitioning with translucent colors.

An example is the halfway transition between transparent (0, 0, 0, 0)
and white (1, 1, 1, 1). Previously, all 4 values where transitioned
separately and the result was semi-transparent gray (0.5, 0.5, 0.5,
0.5).
By depending on the alpha value, the result is now semi-transparent
white (1, 1, 1, 0.5) which is what one would naively expect.

New reftest: color-transition
2015-06-26 21:12:50 +02:00
Benjamin Otte
142abce46a cssvalue: Special case resulting color for transparency
Again, preparation for using premultiplied color transitions.
2015-06-26 20:54:57 +02:00
Benjamin Otte
e3d8f03b3a cssvalue: Restructure RGBA transitions
Split out a function to make the code clearer for the changes ahead.
2015-06-26 19:06:02 +02:00
Lapo Calamandrei
029800c426 Adwaita: entry linking fixes
Set the right border color on the linked entry after the focused
one.
2015-06-25 20:04:32 +02:00
Lapo Calamandrei
56a3fd888a Adwaita: rubberbands!
Darken the rubberband a bit to make it visible on the selected
color background, fix treeview rubberband border issue.
2015-06-25 19:57:07 +02:00
Carlos Garnacho
0606b525b4 gtkdnd: Plug a leak
We create a cairo_t in order to find out the surface extents, but it
was being leaked, dragging the whole drag surface with it through
extra refs.
2015-06-25 15:09:56 +02:00
Carlos Garnacho
33f9cbafcd gtkmodelbutton: Plug a leak
The private struct had some data that needed freeing, but this widget
didn't have any destroy/dispose/finalize handlers.
2015-06-25 15:09:56 +02:00
Carlos Garnacho
6de82c9be3 gtkmenusectionbox: plug a leak
The list returned by gtk_container_get_children() wasn't being freed.
2015-06-25 15:09:56 +02:00
Matthias Clasen
f8b7623b3c builder-tool: Don't strip h/vexpand
Setting these properties has the side-effect of setting the
corresponding -set properties, which makes GTK+ behave subtly
different. So don't mess with these.
2015-06-25 07:01:26 -04:00
Matthias Clasen
e9e9dfade6 GtkSearchBar: Don't vexpand
It turns out that setting vexpand to its default value has
side-effects that we need.

https://bugzilla.gnome.org/show_bug.cgi?id=751447
2015-06-25 07:00:13 -04:00
cedlemo
d31e1fbef0 GtkImage: Make resource property work properly
gtk_image_set_from_resource was setting the resource_path,
only to have it overwritten again before returning. That
is not as it should be, so change things to set the resource
path late.

https://bugzilla.gnome.org/show_bug.cgi?id=751443
2015-06-25 06:50:44 -04:00
Christoph Reiter
48ea0cbe4b GtkWindow: some min/nat size corrections.
Don't add the container border to the title request size; it
is only used for the child widget.

Don't call gtk_widget_get_preferred_width_for_height() for
the title bar with an unrelated height and subtract the title
bar height before querying the child widget width.

Guard against negative size requests after substracting the
borders/shadows and the title bar.

https://bugzilla.gnome.org/show_bug.cgi?id=751341
2015-06-24 10:58:30 +02:00
Matthias Clasen
3b97a0b940 Fix an oversight 2015-06-23 16:46:26 -04:00
Matthias Clasen
7f0606509d GtkPlacesSidebar: Simplify sidebar code
Make this code follow GTK+ styles and conventions better.
2015-06-23 16:35:17 -04:00
Matthias Clasen
ae8c07c67c GktPlacesSidebar: Plug a ton of leaks
If you don't keep in mind that g_object_get() returns references to
objects and copies fo strings, things leak all over the place.
2015-06-23 16:35:17 -04:00
Matthias Clasen
f2a8ddfecf sidebarrow: Avoid object-valued properties
They tend to leak...as these do.
2015-06-23 16:35:17 -04:00
Benjamin Otte
9f27ee7f5a render: Fix ridge/groove border rendering
The typo strikes again!
2015-06-23 22:33:40 +02:00
Christoph Reiter
335c070f9b GtkHeaderBar: reduce minimum title width
The minimum title width affects the minimum window width
for CSD windows. To allow smaller windows like without
CSD reduce it a bit (276px vs 156px min width)

https://bugzilla.gnome.org/show_bug.cgi?id=751341
2015-06-23 21:16:37 +02:00
Christoph Reiter
84e99b20ac GtkWindow: fix default empty window size with CSD
In the non-CSD case we checked for 0x0 window size requisition
and replaced it with 200x200 so the window was still visible.
This no longer works in case of CSD as the shadow and title bar
are always added to the requisition resulting in a titlebar/shadow
only window in case there is no child widget (this is currently
visible under wayland or when setting GTK_CSD=1).

Instead of special casing the final window size, special case
the child requisition paths instead. This gives us the same
requisition in both, CSD and non-CSD cases (the header bar
has a too large minimum width atm so the resulting window is
still not the same)

https://bugzilla.gnome.org/show_bug.cgi?id=751341
2015-06-23 21:16:14 +02:00
Lapo Calamandrei
ec9a39977a Adwaita: scale marks visible on the dark variant 2015-06-23 19:11:15 +02:00
Matthias Clasen
1ed21ad3d4 GtkScale: More work on mark spacing
Try harder not to push the scale out of balance by marks. With
this change, the remaining difference in the drawing is down
to asymmetric assets and margins coming out of the theme.
To fully support such asymmetric rendering, we need implement
baseline alignment for scales.

https://bugzilla.gnome.org/show_bug.cgi?id=749650
2015-06-23 09:36:14 -04:00
Matthias Clasen
7ce96cb6ac GtkStack: Avoid some unnecessary complication
We already have an in-destruction flag, so use it.
2015-06-23 06:45:07 -04:00
Christoph Reiter
3c9cca596f Fix calculation of edge input window size in case the real window is too small.
This error resulted in warnings like
"pixman_region32_init_rect: Invalid rectangle passed"

In case the window is smaller than handle_size * 2 the resulting
edge window got a negative size. Prevent that by limiting the
handle size to half the respective edge length. This also
prevents the corner windows from overlapping in case the window
is too small.
2015-06-22 14:22:50 +01:00
Emmanuele Bassi
97e728580c Revert "window: Check if we can use CSD before enabling them"
This reverts commit c5e5ee6749.

It turns out that this commit breaks the default sizing of GtkWindow,
which in turn causes the window to be smaller than the handle size,
which ends up sending invalid rectangles to Cairo.

We'll have to find another way to fix the CSD issue.

See also: https://bugzilla.gnome.org/show_bug.cgi?id=751140

https://bugzilla.gnome.org/show_bug.cgi?id=750343
2015-06-22 14:21:47 +01:00
Paolo Borelli
4e155d784d Avoid spurious operations on destroy
When the stack is destroyed we do not want to waste time running
animations and notifying listeners about which is our current
visible child.

This is not only an optimization, but it is important for the stack
switcher widgets: since they are in another branch of the hieratchy
we do not want to get notifications while the stack is being destroyed.

Based on a patch by Paolo Borelli
https://bugzilla.gnome.org/show_bug.cgi?id=724506
2015-06-21 11:32:31 -04:00
Matthias Clasen
3b43951ba4 Pacify gobject-introspection
gobject-introspection complains about the parameter names of
vfuncs. Why, you ask ? No idea.
2015-06-20 20:29:18 -04:00
Matthias Clasen
93f9a81ac5 GtkRange: Improve zoom handling a bit
The calculation to update the initial slider position on zoom
changes was not working correctly when using keys to toggle
zoom on and off for scales. Avoid it by updating the position
beforehand.
2015-06-20 20:26:42 -04:00
Matthias Clasen
27dabaefa6 GtkRange: Make drag gesture less agressive
Moving the mouse while pressing one of the steppers was making
the slider jump to the end, unexpectedly. This was caused by the
drag gesture kicking in when it shouldn't. Fix this by making
all drag gesture signal handlers only do something if we are in
a drag thats started on the slider.

https://bugzilla.gnome.org/show_bug.cgi?id=751050
2015-06-20 18:37:15 -04:00
Caolán McNamara
b4a88c7287 file chooser: Avoid tall combos
The filter combo box in the file chooser was stretching to match
the height of the extra widgets next to it. Since, stretched combo
boxes are not a pretty sight, make it stick to the top instead.

Patch by Caolán McNamara,

https://bugzilla.gnome.org/show_bug.cgi?id=751227
2015-06-20 10:55:02 -04:00
Matthias Clasen
b684e70dd5 GtkOverlay: Sync up parameter names
gtk-doc gets confused if the parameter names between header,
source and doc comment don't match up.
2015-06-20 10:52:44 -04:00
Matthias Clasen
3c711cc98a Fix a typo
gtk-doc complained about a multi-line Since: tag, but the
real culprit was a typo in the Deprecated: tag.
2015-06-20 10:52:01 -04:00
Matthias Clasen
d642ae78fc GtkWindow: Small documentation addition 2015-06-20 10:36:09 -04:00
Matthias Clasen
5981e15115 GtkTextView: Small documentation addition 2015-06-20 10:33:56 -04:00
Matthias Clasen
2caa1deb5b Fix up index for some 3.14 symbols
Marking these as "Since: 3.14.1" may be more accurate, but
it causes gtk-doc to not put these symbols in any versioned
index at all (it generates an unused index for 3.14.1). So,
lets lie a little, and say these symbols were added in 3.14.
2015-06-20 10:28:03 -04:00
Matthias Clasen
2f8e4f2685 GtkAssistant: Fix criticals on dispose
After the recent change thta introduced boxes between the pages
and the notebook, we were no longer careful enough when disposing
the assistant. Fix that up.
2015-06-19 21:56:29 -04:00
Matthias Clasen
a4dcc6bc52 file chooser: Small cleanup
Ask the search model if it is empty, instead of maintaining this
information manually in the file chooser widget.
2015-06-19 01:04:42 -04:00
Matthias Clasen
66b5d2e523 GtkSearchEngineTracker: Fix SPARQL syntax
The function is called tracker:uri-is-descendant, not
tracker-uri-is-descendant.
2015-06-19 01:04:18 -04:00
Matthias Clasen
489b48d0b5 Forgotten file 2015-06-19 01:03:28 -04:00
Matthias Clasen
9426fb08ce GtkSearchEngineSimple: Avoid a private struct
We can just make this type final, and avoid the private struct.
2015-06-19 00:48:29 -04:00
Matthias Clasen
ca31662630 GtkSearchEngineTracker: Avoid a private struct
We can just make this type final, and avoid the private struct.
2015-06-19 00:41:10 -04:00
Matthias Clasen
d9a22e7e30 Avoid an unnecessary check
We create the indexed_locations array unconditionally.
2015-06-19 00:34:28 -04:00
Matthias Clasen
ed50772b41 GtkSearchEngine: Avoid a crash
Add a destroy notify for the data of the callback, so we don't
end up leaving a dangling pointer behind for a short while if
the native engine is finalized before the simple one. This
was showing up as crash when typing and backspacing in the
search entry of the file chooser.
2015-06-19 00:32:49 -04:00
Matthias Clasen
d12c7186b6 GtkSearchEngine: Avoid crawling indexed locations
Implement the IsIndexed callback for tracker. This requires
reading settings of the tracker file miner. We are careful
to avoid a hard dependency on the tracker schemas.
2015-06-19 00:12:46 -04:00
Matthias Clasen
c7d86ef4e4 GtkSearchEngine: Avoid crawling indexed locations
Add a framework to the simple engine that allows to skip
locations which are indexed by the native engine.
2015-06-19 00:11:01 -04:00
Matthias Clasen
33e2d12e90 GtkSearchEngine: Initialize recursive flag
Otherwise all our searches become non-recursive, which was not
the intention.
2015-06-19 00:06:51 -04:00
Matthias Clasen
a3a58fa7d9 GtkSearchEngine: Add recursive flag
Add a flag for recursive search, and implement non-recursive
search in both the tracker and simple search engines.

This is not currently used in the file chooser.
2015-06-18 22:59:44 -04:00
Matthias Clasen
15a41e0bf5 Remove an unused field 2015-06-18 22:40:49 -04:00
Matthias Clasen
d260d2c466 GtkSearchEngine: Remove unused code
Nothing ever uses or emits the hits-subtracted signal.
Nautilus dropped it a few years ago. Time to follow suit.
2015-06-18 17:08:09 -04:00
Matthias Clasen
1d63335c8e Use infos from search engine instead of getting them again
When the search engine provides hits with GFileInfo, use that
to add the hits to the model directly, without going through
another round of async get_info calls.

To do this, we add a batched variant of the
_gtk_file_system_model_update_file call that takes lists of
GFiles and GFileInfos. Again, we can avoid repeated resorting
that happens when the files are updated individually.
2015-06-18 15:20:06 -04:00
Matthias Clasen
1b755c546e Fix an oversight in the previous commit
We lost the line marking the search model as non-empty, causing
us to show the 'no results' page despite there being results.
2015-06-18 15:14:54 -04:00
Matthias Clasen
56c05c429f Request the right attributes in the simple search engine
This change makes it so that the file info passed along
from the simple search engine has all the attributes that
the file system model wants.
2015-06-18 14:37:23 -04:00
Matthias Clasen
abe4829e36 search engine: Pass file infos along for hits 2015-06-18 14:33:13 -04:00
Matthias Clasen
4b8df8c546 file chooser: Use batched insertion for search results
This helps avoiding excess work when procesing many search
results, as typically happens with short search strings
and recursive search.

https://bugzilla.gnome.org/show_bug.cgi?id=751169
2015-06-18 13:11:30 -04:00
Matthias Clasen
b2ceadb057 file system model: Add batched insertion
Add a batched version of gtk_file_system_model_add_and_query_file
that takes a list of files and avoids resorting the model for each
individual insertion. The querying is still done one-file-at-a-time,
so more optimization is certainly possible.
2015-06-18 13:11:30 -04:00
Emmanuele Bassi
9590879e2f Revert "window: Reinstate logic for should_use_csd()"
This reverts commit f043fd532d.

The whole point of having can_use_csd() return TRUE when GTK_CSD is
unset is to use it inside enable_csd().

https://bugzilla.gnome.org/show_bug.cgi?id=751140
2015-06-18 16:10:36 +01:00
Emmanuele Bassi
f043fd532d window: Reinstate logic for should_use_csd()
The old should_use_csd() function would return FALSE if the GTK_CSD
environment variable is unset; the change in commit c5e5ee6749
made it return TRUE if GTK_CSD is unset. This has a cascade effect
on the window size, which causes invalid rectangles to bubble down
to Pixman.

https://bugzilla.gnome.org/show_bug.cgi?id=751140
2015-06-18 14:52:17 +01:00
Timm Bäder
c82ce07d80 gtkdialog: Remove 2px border 2015-06-18 15:41:29 +02:00
Timm Bäder
b61d79e354 messagedialog: remove 2px border 2015-06-18 15:41:28 +02:00
Timm Bäder
a97a3d6a5b filechooserdialog: Remove space between window and content
Was removed in 232d6f84f0.
2015-06-18 15:41:28 +02:00
Jakub Steiner
dc8cc6291b Adwaita: indentation
- lapo was shouting at me.
2015-06-18 13:09:22 +02:00
Lapo Calamandrei
3a462b174d Adwaita: volume button and scale button padding
I was assuming that GtkVolumeButton and GtkScaleButton could only
contain a icon, now they get the image-button padding by default,
but if the text-button class is applied it is not overridden.
2015-06-18 12:46:00 +02:00
Lapo Calamandrei
5e616e0298 Adwaita: scale popup quick fix 2015-06-18 12:33:59 +02:00
Jakub Steiner
58813a0db1 Adwaita: markup cleanup
- move touch selection selectors to its own section
- use scss style markup for .button common elsewhere
  (more compact and legible)
2015-06-18 12:01:12 +02:00
Jakub Steiner
ff20abda8e HC: touch text selection styling
- sync with Adwaita
- try to avoid using image assets

https://bugzilla.gnome.org/show_bug.cgi?id=750883
2015-06-18 11:56:20 +02:00
Ting-Wei Lan
f85db624eb Fix return value error in _gtk_window_get_popover_parent 2015-06-18 12:14:44 +08:00
Matthias Clasen
00616bc199 Cosmetic change 2015-06-17 20:24:29 -04:00
Matthias Clasen
0f7857f66a GtkPlacesSidebar: Fix rtl appearance
Apply the necessary directional variants for asymmetric
css padding.

https://bugzilla.gnome.org/show_bug.cgi?id=751084
2015-06-17 20:14:54 -04:00
Cosimo Cecchi
9c7b0f0491 overlay: remove gtk_overlay_add_pass_through_overlay()
The API to access this functionality will be the setter we just added in
the previous commit.

https://bugzilla.gnome.org/show_bug.cgi?id=750568
2015-06-17 11:48:37 -07:00
Cosimo Cecchi
3b1b171be5 overlay: add setters and getters for pass-through child property
This will make the API easier to use from bindings too.

https://bugzilla.gnome.org/show_bug.cgi?id=750568
2015-06-17 11:48:37 -07:00
Matthias Clasen
8612942fe2 file chooser: Drop unused variables 2015-06-17 10:01:04 -04:00
Matthias Clasen
916cf8f61e file chooser: Use a revealer
Use a revealer to manage the visibility of the header area where
we show the pathbar, the location entry or search. This is a bit
smoother, and makes search more similar to a search bar.
2015-06-17 10:01:04 -04:00
Carlos Garnacho
15bb9acc8a texthandle: Avoid double rendering of background/frame
gtk_render_handle() already renders background/frame itself, avoid
doing this twice.
2015-06-17 15:58:55 +02:00
Carlos Garnacho
77d429bc4d gtkmain: Ignore grab for events in child popovers
Popovers may be spawn when there's GTK+ grabs somewhere else (eg.
text selection popover/handles in an entry in a modal popover). When
this happens, events go to the grab widget (in this case the modal
popover) and are effectively ignored by the event widget, even though
it's can be conceptually a child of the grab widget.

To get away with this, tweak a bit gtk_main_do_event(), so events going
to popovers that are related to grab_widget or a child of it are received,
as it would happen with regular children of grab_widget.

https://bugzilla.gnome.org/show_bug.cgi?id=750993
2015-06-17 15:56:42 +02:00
Carlos Garnacho
76dc8aced5 window: Add concept of popover "parent"
This will be the widget that the popover relates to (::pointing-to in
GtkPopover, ::parent in GtkTextHandle).

Additional API to check the popover/parent relationship between widgets
has been added, which will be useful wherever this is necessary in a
generic manner.

https://bugzilla.gnome.org/show_bug.cgi?id=750993
2015-06-17 15:56:42 +02:00
Christian Hergert
fb06b6e4b8 treeview: always pixelcache widget contents
GtkTreeView has a particularly expensive drawing path. This can cause
issues when part of animated widget sequences. Caching the content while
a model is attached helps reduce the number of full redraws during
exposure greatly.

https://bugzilla.gnome.org/show_bug.cgi?id=751082
2015-06-16 18:08:22 -07:00
Christian Hergert
6a2143ab31 pixelcache: allow widgets to always require cached content
Some widgets have very expensive drawing paths. So caching the content
can be useful even when not scrolling.

This can help speed up widgets that are part of animation sequences and
thereby go through spurious expose events.

https://bugzilla.gnome.org/show_bug.cgi?id=751082
2015-06-16 18:08:22 -07:00
Carlos Soriano
569e59b2c5 gtkplacessidebar: improve variable name 2015-06-16 16:54:24 +02:00
Carlos Soriano
0bb82bf1de gtkplacessidebar: Remove some old comments
We didn't made up our minds until now from some of them, and for
the others no progress has been made or bugs reported, so probably
they are fine.
2015-06-16 16:25:33 +02:00
Carlos Soriano
fbbad5deec gtkplacesidebar: use GtkListBox
We were using GTkTreeView in a simple list. Also, as we know,
GtkCellRenderers are not the best way to theme and manipulate
widgets.

So instead use a GtkListBox to modernize the GtkPlacesSidebar,
and in the way clean up some parts of the code (like headings)
which were not used anymore.
Also we don't use a model anymore, since the data is simple
enough to manage it in a subclass of the row itself.
2015-06-16 16:19:37 +02:00
Carlos Soriano
d881b15349 theme: decrease list row transition
It was somewhat annoying given the "trace" of it. Decrease
the time to avoid too much "trace"
2015-06-16 16:19:37 +02:00
Carlos Soriano
43a4843b9c gtkfilechooserwidget: show drop hints on gtkplacessidebar
Now with the API addition on gtkplacessidebar, we can show some
hints for the drop targets.

https://bugzilla.gnome.org/show_bug.cgi?id=747793
2015-06-16 16:19:37 +02:00
Carlos Soriano
4499174e32 gtkplacessidebar: make insensitive invalid drop targets
https://bugzilla.gnome.org/show_bug.cgi?id=747793
2015-06-16 16:19:37 +02:00
Carlos Soriano
fb034f38b3 gtkplacessidebar: add new bookmark icon
Following design mockups

https://bugzilla.gnome.org/show_bug.cgi?id=747793
2015-06-16 16:19:37 +02:00
Carlos Soriano
a9b698b265 gtkplacesidebar: remove obsolete drop state
We didn't use those for some time now.
2015-06-16 16:19:37 +02:00
Carlos Soriano
91e1e80862 gtkplacessidebar: add API for show drop hints
It is convenient to allow applications to show all the drop
targets at once. This improves the user experience with drag
an drop.

The new API allows the application to set the gtkplacessidebar
in a mode where invalid drop targets are insensitive and it
adds a "new bookmark" row. This mode is intended to be set
when the application is aware of a dnd operation and needs to
be stopped kwhen the application is aware that dnd operation
was cancelled or ended in a different part than gtkplacesisdebar.

The context parameter is unused in this patch, but will be
used in next patches when the sidebar will use a GtkListBox.
The reason of being unused now is just convenience.

https://bugzilla.gnome.org/show_bug.cgi?id=747793
2015-06-16 16:19:37 +02:00
Carlos Soriano
4371cc8f01 gtkplacessidebar: new bookmark row only at first position
Following the new mockups, put the new bookmark row always
in the first position, so it's easier to drop an item.

https://bugzilla.gnome.org/show_bug.cgi?id=747793
2015-06-16 16:19:36 +02:00
Matthias Clasen
e367c4baa0 Deal with events from wrong display
GtkInspector is opening a separate display connection, which makes
it more likely that gtk_get_current_event() returns an event from
the "wrong" display.
2015-06-15 19:50:02 -04:00
Matthias Clasen
002699402d GtkMenuButton: Make programmatic toggling work again
This was broken in 0796d7b6ff.

https://bugzilla.gnome.org/show_bug.cgi?id=751018
2015-06-15 19:49:49 -04:00
Matthias Clasen
f99375f91e GtkMenuButton: Avoid direct button access
We were getting ourselves in trouble by casting touch events
to GdkEventButton and poking directly at their internals. Instead,
use GdkEvent API to get what we need.

This fixes a crash when using the gear menu in epiphany with
touch. The same crash also occurred in testmenubutton.
2015-06-15 18:54:13 -04:00
Alexander Larsson
9fc19b5a26 gtkoverlay: Fix issues with remove
The iteration now progresses past a delete, so make sure we iterate
safely. Also, don't chain up if we removed a child.
2015-06-15 16:32:50 +02:00
Alexander Larsson
4dd66b0c53 GtkOverlay: Add support for input pass-through overlays
For these widgets we set pass-through on the child window so that
input over these widgets (that are not on a child input window) goes
to the window below the overlay.

https://bugzilla.gnome.org/show_bug.cgi?id=750568

https://bugs.freedesktop.org/show_bug.cgi?id=90917
2015-06-15 10:56:46 +02:00
Alexander Larsson
76ba5a03b9 overlay: Add reorder_overlay()
This allows you to control the z-ordering of overlay children

https://bugzilla.gnome.org/show_bug.cgi?id=750568

https://bugs.freedesktop.org/show_bug.cgi?id=90917
2015-06-15 10:56:45 +02:00
Benjamin Otte
fe51ac273c stylecontext: Change fallback behavior on state mismatch
For functions that take state flags as an argument we need to special
case the situation where the passed in flags don't match the current
state.

Previously we would create a copy of the style info, change its state
and do the lookup from there.

Now that GtkCssNode has replaced style infos, this doesn't work as well
anymore as copying a GtkCssNode is not possible.
However, unike style infos, GtkCssNodes are instant-apply, so we don't
need to copy anymore, we can just change the state of the node.

This causes some invalidations to be queued, but we can take that
performance hit as this is fallback code.

https://bugzilla.redhat.com/show_bug.cgi?id=1228852
2015-06-15 04:36:47 +02:00
Matthias Clasen
c3a0880cd6 GtkAssistant: Add a way to have pages without padding
This can be useful when embedding complex widgets like
a file chooser as a page.

https://bugzilla.gnome.org/show_bug.cgi?id=750631
2015-06-14 21:29:09 -04:00
Matthias Clasen
6cc65260f4 GtkAssistant: Redo page margins
Instead of having padding outside the notebook containing
all pages, put each page in an extra box and add the padding
there. This is in preparation for allowing pages without
padding.
2015-06-14 21:04:15 -04:00
Matthias Clasen
cfd85dee03 assistant: Drop hardcoded padding
This means the pages themselves will be responsible for setting
suitable padding.

https://bugzilla.gnome.org/show_bug.cgi?id=750631
2015-06-14 20:54:47 -04:00
Matthias Clasen
d1f2e5896b color editor: make popups toggleable
The popups on the color editor are somewhat hard to get rid of.
Arrange things so that clicking the same control again dismisses
the current popup.
2015-06-13 22:32:05 -04:00
Matthias Clasen
822886edbc Don't show a menu on the color editor swatch
There's nothing to customize here, so no need to show a menu.
2015-06-13 21:57:07 -04:00
Matthias Clasen
98a3fac6ab Add a way to avoid menu on color swatches 2015-06-13 21:56:41 -04:00
Matthias Clasen
1bba3b0a38 Avoid uninitialized variables
clang complains that these may be used uninitialized.
2015-06-13 21:10:26 -04:00
Matthias Clasen
8cbed0b04a entry: Drop an unused variable 2015-06-13 21:10:26 -04:00
Matthias Clasen
047ad11353 Drop an unused variable 2015-06-13 21:10:26 -04:00
Matthias Clasen
5b162fa44a GtkColorEditor: Remove old todo
Most of this is done, and the rest will not happen because
of this note.
2015-06-13 21:10:25 -04:00
Ting-Wei Lan
d8657a8156 Fix return value error in _gtk_text_handle_set_direction
https://bugzilla.gnome.org/show_bug.cgi?id=750888
2015-06-13 23:00:21 +08:00
Matthias Clasen
6f955a7df6 Redo font map support in GtkFontChooser
We can't add properties to the interface, since it breaks
3rd party implementations of the GtkFontChooser interface.
These exist, for example in gnumeric.

So, instead of a new property, add getter/setter vfuncs.
2015-06-13 00:00:51 -04:00
Benjamin Otte
8c6130e68a fontchooser: Don't cause "row-changed" signal in cell data func
The font chooser delays creating the font description from the font face
as long as possible (it's slow). Because we use fixed height mode, we
only have to create font descriptions for rows we are actually going to
show.

This was achieved by looking at the font description column and if it
was NULL, we created a font description and gtk_list_stiore_set() it.
Unfortunately this caused a "row-changed" signal to be emitted and this
emission could happen during the cell data func.
And that caused infinite loops with accessibility when you were unlucky.

This change replaces the NULL font description with an empty one and
instead of setting the correct font description, we
pango_font_description_merge() it in. This way, the list store doesn't
change and no signals are emitted.

https://bugzilla.redhat.com/show_bug.cgi?id=1197267
2015-06-12 22:04:17 +02:00
Carlos Garnacho
a01fe14056 popover: Avoid hiding modal popovers if another popover is taking focus
Due to popover modality itself, there's quite high chances the popover
stealing focus has been triggered from within, so stay friendly to it.
Hiding the popover here will only hide the grabbing popover too if this
happens.

https://bugzilla.gnome.org/show_bug.cgi?id=750741
2015-06-12 21:00:45 +02:00