Commit Graph

25093 Commits

Author SHA1 Message Date
Benjamin Otte
a920f7260c treeview: Reposition dnd button css node properly
After the drag ends, the button node went to the wrong place and then
looked like a regular button. Fix that.
2015-12-15 08:41:16 -05:00
Benjamin Otte
26d536a69b inspector: Fix quick-fix
Constructing GtkCssStyleChange objects without styles is forbidden, so
don't do it. Instead untangle the callback from the actual update
function and call that untangled function directly.
2015-12-15 01:15:51 +01:00
Benjamin Otte
f6606c4f6f cssnode: Clear cache if reusing style
When we reuse styles that didn't change across changes to the source
CSS, make sure we clear the caches. Otherwise child nodes will pick up
styles from the old source CSS.
2015-12-15 01:15:51 +01:00
Carlos Garnacho
f663d17c14 GtkTreeView: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:56 +01:00
Carlos Garnacho
91b5497d69 GtkNotebook: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:56 +01:00
Carlos Garnacho
fad174b967 GtkEntryCompletion: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:55 +01:00
Carlos Garnacho
534b0af512 GtkComboBox: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:55 +01:00
Carlos Garnacho
d54f208d29 GtkMenu: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:55 +01:00
Carlos Garnacho
5cbbb90e31 GtkCellRendererAccel: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:55 +01:00
Carlos Garnacho
e4eeec2163 GtkButton: Use gdk_seat_grab()
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:32:55 +01:00
Matthias Clasen
a22c1ec980 dnd: Cleanups
Remove some now unused includes and dead code, and rename
gtk_drag_set_icon_window to gtk_drag_set_icon_widget_internal,
since it is no longer restricted to toplevel windows.
2015-12-13 18:24:41 -05:00
Matthias Clasen
95f648147d dnd: Stop doing cancel animation in GTK+
Under Wayland, the compositor does it, so there is no need
for us to move the window ourselves. For X11, we are now
doing the animation from the X11 backend. Trigger that by
calling gdk_drag_drop_done().

What changes here is that we have to keep the icon_window
alive for as long as the drag context exists. Use a weak
reference to do so.
2015-12-13 16:02:02 -05:00
Matthias Clasen
a24bbcbb8d dnd: Pass start coordinates when creating the drag context
This will be used in subsequent commits.
2015-12-13 10:39:43 -05:00
Benjamin Otte
eb97ef0514 cssnode: Set new style if it's animated
In commit 2c61316677 we avoided emitting
the style-changed signal if no CSS property changed.

Unfortunately, this also caused CSS styles to not be updated when
animations started if those animations did not change any CSS value
immediately. In those cases the animation would just never start.
The obvious example was the spinner.
2015-12-13 16:12:39 +01:00
Benjamin Otte
5cbbc62026 widget: Pass a GtkCssStyleChange instead of a bitmask 2015-12-13 04:11:58 +01:00
Timm Bäder
c219bdbecc Gestures: Add some nullable annotations 2015-12-12 09:29:08 +01:00
Timm Bäder
c3fd1b3b73 GtkFlowBox: Add missing nullable annotation 2015-12-12 09:29:08 +01:00
Timm Bäder
c02f68f0ba GtkFlowBox: Fix copy/paste mistake in docs 2015-12-12 09:29:08 +01:00
Benjamin Otte
776f034e2d cellrendererpixbuf: Don't set icon size for pixbufs
The code before the refactorings didn't set it, so we now don't set it
either.

Fixes images being way too smal inside iconviews.
2015-12-12 03:24:32 +01:00
Benjamin Otte
2c61316677 cssnode: Catch case where a style didn't change
Catch the case where a CSS style did not change and don't emit the
style-changed signal in that case.

This saves not only the emission of the signal, but also doesn't cause
invalidation in child nodes, which would previously get a PARENT_STYLE
2015-12-12 02:16:04 +01:00
Benjamin Otte
971a277419 cssnode: Change style-changed signal
Instead of having old and new style, now have a GtkCssStyleChange opaque
object that will compute the changes you are interested in for you.

This simplifies change signal handlers quite a bit and avoids lots of
repeated computation in every signal handler.
2015-12-12 02:16:04 +01:00
Matthias Clasen
0ad259a178 inspector: Hide request mode for non-widgets
Only widgets have a request mode.
2015-12-11 17:12:44 -05:00
Lapo Calamandrei
bb16ba7e31 Adwaita: menu color change on the dark variant only 2015-12-11 21:08:53 +01:00
Matthias Clasen
fb937984af file chooser: Also apply the settings
I forgot that the settings object we're dealing with here
is in delay mode, so settings won't apply immediately.
2015-12-11 12:25:31 -05:00
Matthias Clasen
d4654dd10b file chooser: Store size more frequently
We were only storing the dialog size on unmap, but resetting to the
stored default value more often, e.g. on focus-out. This was causing
the dialog to 'jump back' to its remembered size after the user
manually resized it, leading to frustration and bug reports.

Instead, save the dialog size on every ::size-allocate of the toplevel.
To avoid needlessly spamming dconf, only write the new value if it
changed.
2015-12-11 12:15:03 -05:00
Georges Basile Stavracas Neto
8884e82af8 placesviewrow: remove unneeded functions
These function declarations are not used nor implemented
anywhere, so remove them.
2015-12-11 02:28:39 -02:00
Matt Watson
ae487840f0 gtkstack: remove needless queue_resize
In gtk_stack_set_transition_position we should only need to
queue_resize if we are non-homogeneous, which is already done
earlier in the function.
2015-12-10 16:51:29 -08:00
Georges Basile Stavracas Neto
67125ae4e0 placesview: implement available space
GtkPlacesView is a widget to display locations
in the computer, such as root ("/") and volumes,
separating the persistent devices from removable
ones.

From the latest mockups[1], GtkPlacesView would
display the available space of local drives like
partitions. This, however, is not implemented in
the current codebase.

Fix that by implementing the measurement of disk
space, and adding a new property GtkPlacesView::show-disk-usage
which controls the visibility of measured disks.

[1] https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/nautilus/nautilus-next/other-locations.png

https://bugzilla.gnome.org/show_bug.cgi?id=759225
2015-12-09 20:30:10 -02:00
Cosimo Cecchi
5f45878133 statusicon: plug memory leak 2015-12-09 10:45:26 -08:00
Lapo Calamandrei
191b9d84fa Adwaita: make menu bg color the same as popovers
fixes https://bugzilla.gnome.org/show_bug.cgi?id=759260
2015-12-09 18:56:38 +01:00
Lapo Calamandrei
d266151fee Adwaita: another try at color tweakings... 2015-12-09 17:43:40 +01:00
Lapo Calamandrei
f51dfb7af8 Adwaita: some more color tweaks and sass simplification 2015-12-09 17:38:38 +01:00
Lapo Calamandrei
07506a9088 Adwaita: fix popover styling
...in the process simplified the touch-selection styling, check
and radios not fixed there since I'm going to add proper osd assets
for those (istead of forcing the dark variant assets there as before).
2015-12-09 14:54:15 +01:00
Benjamin Otte
861ac8e373 iconhelper_ Don't use deprecated functions
Use gtk_widget_get_direction() instead of
gtk_style_context_get_direction().
2015-12-09 13:30:40 +01:00
Benjamin Otte
ccfc4d3f12 iconhelper: Remove the context argument
Instead, use the widget's context.
2015-12-09 13:30:40 +01:00
Benjamin Otte
e95e2d5048 iconhelper: Get rid of _gtk_icon_helper_set_window()
Instead use the window of the owner widget.
2015-12-09 13:30:40 +01:00
Benjamin Otte
c9d1a45d30 iconhelper: Require a widget as construction argument
Note that the caller needs to ensure the widget lives as long as the
iconhelper as the iconhelper will not ref the widget.
2015-12-09 13:30:40 +01:00
Benjamin Otte
ee5758a4e1 statusicon: Port from iconhelper to imagedefinition 2015-12-09 13:30:40 +01:00
Benjamin Otte
866e7dc733 cellrendererpixbuf: Create iconhelper on-demand
Instead of storing one in the priv structure, only store an image
definition there.

This will allow future refactorings of the icon helper.
2015-12-09 13:30:40 +01:00
Benjamin Otte
01387428a3 iconhelper: Pass only the CssStyle when loading pixbufs 2015-12-09 13:30:40 +01:00
Benjamin Otte
6afeab4313 iconhelper: Remove unused GtkStyleContext parameters 2015-12-09 13:30:40 +01:00
Benjamin Otte
cf77c1695d iconhelper: Pass only the CssStyle when loading iconsets 2015-12-09 13:30:40 +01:00
Benjamin Otte
88a490fe58 iconfactory: Move private functions into private header 2015-12-09 13:30:40 +01:00
Benjamin Otte
ee6e685478 iconhelper: Pass only the CssStyle when loading icons
This is the first step in replacing StyleContext usage with CssNode
usage.
2015-12-09 13:30:39 +01:00
Matthias Clasen
8edbbde127 toolitem: Set a css name 2015-12-08 20:53:56 -05:00
Sébastien Wilmet
e2d1042b6b Don't use gtk_text_iter_begins_tag() (deprecated)
Use gtk_text_iter_starts_tag() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=759092
2015-12-08 19:56:57 +01:00
Sébastien Wilmet
1dcb3a0f88 textiter: add starts_tag() and deprecate begins_tag()
The name gtk_text_*_begins_* was used only for begins_tag(). All other
similar functions use "starts": starts_line(), starts_word(), etc.

So for consistency, add gtk_text_iter_starts_tag() and deprecate
gtk_text_iter_begins_tag().

Also change (allow-none) to (nullable), to use the new annotation.

https://bugzilla.gnome.org/show_bug.cgi?id=759092
2015-12-08 19:55:53 +01:00
Kalev Lember
9103707922 headerbar: Don't leak internal widgets
Make sure to clean up internal widgets in destroy, as these aren't
cleaned up when GtkContainer walks the childrens list in
gtk_container_destroy().

This also fixes a gedit crash as reported in
https://bugzilla.redhat.com/show_bug.cgi?id=1288669

https://bugzilla.gnome.org/show_bug.cgi?id=759132
2015-12-07 22:15:25 -05:00
Matthias Clasen
bf7a7a5f3d dnd: pass hotspot to GDK
This uses the new api introduced in the previous commits.
2015-12-07 21:54:55 -05:00
Matthias Clasen
08ecf19907 dnd: Remove an unused struct field
We only have one screen nowadays, so the fallback_icon is
never used.
2015-12-07 21:15:23 -05:00
Carlos Garnacho
c0477c2c52 GtkNotebook: Use gdouble in coordinate calculations
Otherwise rounding errors fool the "tab under coordinates" checks on
crossing events, which will be triggered close enough to the window
rectangle if the pointer moves slowly enough.

With this, the tab_prelight() function correctly figures out we've
moved the pointer outside the tab area when called in
gtk_notebook_leave_notify().

https://bugzilla.gnome.org/show_bug.cgi?id=759091
2015-12-07 17:40:01 +01:00
Adam Reichold
5088b4937e Fix method to update menu sensitivity of combo box
After removal of the selectable header and separator from the combo box,
the method to update the menu sensitivity must be changed as it assumes
at least two items within each sub menu and contains special handling
for the separator. Removing this fixes bug #759079.
2015-12-07 11:23:18 -05:00
Matthias Clasen
f7cc4abbad Avoid ugly seams on half-tiled terminals
Since we're no longer doing geometry widgets, don't send
base size and increments to the window manager anymore either.
This avoids an ugly 2 pixel gap to the right and bottom of half-tiled
terminals under gnome-shell.
2015-12-07 10:11:06 -05:00
Matthias Clasen
88c4d06973 accel cellrenderer: Fix rendering
We were getting the "New Accelerator" text mixed with the
content of the underlying cell, since plain labels don't
have a background. Go back to putting the label in selected
state, and fix the theme to render that white-on-blue. This
was lost when we switched to using a selection sub-node.
2015-12-07 07:04:43 -05:00
Erika
05dd21be88 Correct annotations for gtk_cell_layout_get_area
The function can return NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=759081
2015-12-07 06:16:59 -05:00
Matthias Clasen
326f4739ca inspector: Redo the CSS node page
Showing two lists in a paned was a bit awkward, and space was
getting too limited. Go back to showing just the node list at
first, and make the CSS properties available via a stack. At
the same time, add a right-click context menu to the node list
to make the name and class editing more easily available.
2015-12-06 23:06:33 -05:00
Matthias Clasen
6f1c945010 inspector: Avoid a crash
gkt_cell_layout_get_area may return NULL, handle it.
2015-12-06 17:25:31 -05:00
Matthias Clasen
9c73603c16 css node: Some more docs 2015-12-06 15:42:13 -05:00
Matthias Clasen
2188fe0e54 places view: Use names for cursors
Use the standard name for the busy+interactive cursor.
2015-12-05 19:18:27 -05:00
Matthias Clasen
f76fa0411f entry: Always use cursor names
The names are the preferred API for cursors, so use it.
2015-12-05 19:17:52 -05:00
Matthias Clasen
93b3669273 Be forgiving if cursors are missing
No need to crash here. Missing cursors are ugly, but we
shouldn't crash.
2015-12-05 18:55:05 -05:00
Matthias Clasen
c73325c6b0 entry completion: Reduce the timeout
Pop up the completion window after 100ms. The previous timeout
of 300ms was making completions feel slow.

https://bugzilla.gnome.org/show_bug.cgi?id=758929
2015-12-05 14:12:27 -05:00
Matthias Clasen
12dbfe026f shortcuts: Another attempt to fix up forall
gtk_window_set_titlebar does not take ownership of the headerbar,
so we need to explicitly destroy it.
2015-12-05 13:53:23 -05:00
Matthias Clasen
c83ab24237 Remove GtkShortcutsGesture
The gesture functionality was taken over by GtkShortcutsShortcut,
so this widget is no longer needed, and it never was in a stable
release, so lets get rid of it.
2015-12-05 12:10:21 -05:00
Lapo Calamandrei
830b6f10a1 Adwaita: simpler active switch background
...removing the progressbar_fill mixin in the process.
2015-12-05 17:56:32 +01:00
Lapo Calamandrei
8f2cd874f1 Adwaita: first stab at some visual updates 2015-12-05 17:56:32 +01:00
Matthias Clasen
f210dc9281 Fix make check
GtkFontChooserWidget is using a GThemedIcon in its template,
so we need to ensure that the type is registered before
loading it. This was causing the defaultvalue test to fail.
2015-12-04 17:01:03 -05:00
Lionel Landwerlin
55e06e5d52 adwaita: fix property spelling mistake
https://bugzilla.gnome.org/show_bug.cgi?id=759048
2015-12-04 21:04:06 +00:00
Timm Bäder
ecc5342b0d GtkEntry: Recompute in text-inserted/text-deleted
The text-inserted/text-deleted handlers rely on the cursor positions
being unadjusted after the text change, so we can't do it in
buffer_notify_text.
2015-12-04 20:41:16 +01:00
Matthias Clasen
03769e3830 shortcut label: Tweak modifier key rendering
The subscript was affecting the vertical alignment too much,
so tweak the rendering of the L/R markers to avoid that. Also,
mark these as translatable.
2015-12-04 13:22:26 -05:00
Matthias Clasen
27b24bb68f Add a css name to GtkShortcutsShortcut
This will be useful for tweaking the gesture image details,
among other things.
2015-12-04 13:22:26 -05:00
Lapo Calamandrei
5cb06a30a0 Adwaita: added back progressbar.osd style 2015-12-04 19:04:17 +01:00
Lapo Calamandrei
c64452c29d Adwaita: fix scales with marks on the dark variant 2015-12-04 18:47:28 +01:00
Lapo Calamandrei
cfc17a0152 Adwaita: slight color tweaks 2015-12-04 18:43:24 +01:00
Benjamin Otte
d14e2a489a iconhelper: Fold function into callers
The function takes so many arguments and is so short that it's not worth
keeping.
2015-12-04 17:44:51 +01:00
Benjamin Otte
72d4b65b1d iconhelper: Apply icon-effect directly
Instead of creating an icon source, making sure no state is set and
therefore the icon-effect will be applied and then rendering that icon
source, just call the icon-effect apply function.

Also, the new way isn't deprecated.
2015-12-04 17:44:51 +01:00
Benjamin Otte
1b835fc7ce css: Leftover renaming gtk-image-effect => icon-effect
The previous renaming commit was incomplete, so here we go again.
2015-12-04 17:44:51 +01:00
Benjamin Otte
a37220109f render: Split out icon-effect apply function 2015-12-04 17:44:51 +01:00
Benjamin Otte
cefba86fb3 iconhelper: Return surface from icon-effect function
All the callers where converting to a surface anyway.
2015-12-04 17:44:51 +01:00
Benjamin Otte
295f208e1c iconhelper: Refactor missing icon handling
In particular, stop using deprecated code for loading the missing image
icon.
2015-12-04 17:44:51 +01:00
Benjamin Otte
3c54a49633 iconhelper: Fold function into only caller 2015-12-04 17:44:51 +01:00
Benjamin Otte
b8dd24b4fb iconfactory: Drop caching infrastructure
- icon sets are essentially unused
- the icon theme does caching
- this code complicates the restructuring I'm about to do

=> Delete it!
2015-12-04 17:44:51 +01:00
Matthias Clasen
8768c0b8ac shortcuts: Extend the accelerator syntax more
Cover cases like left+right control, and render them nicely.
The gtk3-demo builder shortcuts example shows the new
possibilities.
2015-12-04 10:56:48 -05:00
Timm Bäder
3ba11782db GtkEntry: nullable annotations 2015-12-03 20:20:58 +01:00
Timm Bäder
da477575cd GtkEntry: Return proper constants from signal handlers 2015-12-03 20:01:30 +01:00
Timm Bäder
d86ec52547 GtkTreeModel: Remove erroneous transfer annotation 2015-12-03 20:01:30 +01:00
Timm Bäder
f11f989f1f GtkEntry: Remove recompute idle
Just do it directly
2015-12-03 20:01:30 +01:00
Timm Bäder
cfc23cbf32 GtkEntry: Remove unused fields 2015-12-03 20:01:30 +01:00
Lapo Calamandrei
07ee962ed3 Adwaita: some OSD rationalization
taking care of https://bugzilla.gnome.org/show_bug.cgi?id=732528 in
the process, any toolbar.osd with a positional style class attached
gets squared corners now.
2015-12-03 19:28:57 +01:00
Lapo Calamandrei
d46ab0f62a Adwaita: scale with marks styling
I'm really sorry for the unlucky ones who would have to read that
code...
2015-12-03 18:41:35 +01:00
Lapo Calamandrei
37c943c8cd Adwaita: added back scale marks style 2015-12-03 18:41:35 +01:00
Matthias Clasen
ec5baa144d Update gtk_drag_highlight() docs
What they said was no longer true.
2015-12-03 08:37:58 -05:00
Lapo Calamandrei
234c497474 Adwaita: scale fill style 2015-12-03 12:57:02 +01:00
Sebastien Bacher
635da34908 GtkAppChooserWidget: wrap the label, use a standard icon
Let the label wrap if needed, that's required in some locales, use an
icon which is available in the theme

https://bugzilla.gnome.org/show_bug.cgi?id=758908
2015-12-03 12:45:56 +01:00
Lapo Calamandrei
081bdb07c3 Adwaita: rename scale sass templates to be more specific 2015-12-03 11:43:53 +01:00
Lapo Calamandrei
b7a980d5d8 Adwaita: added back style for scales on selected list rows 2015-12-03 11:38:50 +01:00
Lapo Calamandrei
a291003ad4 Adwaita: first stab at GtkScale and GtkProgressBar rewrite
...scale has marks stuff missing, coming soon.
2015-12-03 10:54:33 +01:00
Benjamin Otte
3ed71cf4a7 window: Deprecate gtk_window_resize_to_geometry()
And make it not do anything anymore.

Fixes erratic resizes of gnome-terminal.

https://bugzilla.gnome.org/show_bug.cgi?id=757282
2015-12-03 10:43:57 +01:00
Olivier Fourdan
de41389352 gtkwindow: Document further resize with csd
Applying the client-side decorations in the configure routine greatly
increases the chances of having the right size for the GtkHEaderBar and
border shadows.

Yet, it may be possible that these sizes change at a later point in
time, if for example the GtkHeaderBar grows in height while adding new
controls.

Mention this possible pitfall in the documentation for
gtk_window_resize().

https://bugzilla.gnome.org/show_bug.cgi?id=756618
2015-12-03 09:16:29 +01:00
Matthias Clasen
058dfb0723 entry: Use regular drag highlight
The entry code passes GTK_DEST_DEFAULT_HIGHLIGHT when setting
up the drop target, but that is ineffective because of the
custom drag_motion implementation. Instead, call
gtk_drag_[un]hightlight ourselves.
2015-12-02 23:52:55 -05:00