Commit Graph

23655 Commits

Author SHA1 Message Date
Matthias Clasen
1da92c2800 GtkListBox: Improve focus scrolling
We are trying to scroll the header in view together with the
focus row. The way this is implemented works fine when scrolling
up, but falls short when scrolling down. Fix this by making sure
that both the row and the header bar visible.
2015-07-19 22:18:58 -04:00
Matthias Clasen
52c4955d21 GtkListBox: Listen for adjustment changes
We automatically pick up an adjustment from our parent
scrollable, but we failed to update it when it changes.
This is happening in the places sidebar, and it was causing
the focus-tracking to fail there, letting the focus move
out of view. With this change, the focus remains visible.
2015-07-19 22:08:36 -04:00
Matthias Clasen
55652b6b09 places sidebar: Improve keynav
Remove the code in the sidebar keypress handler that imperfectly
reproduces what GtkListBox already does: moving selection and
focus in response to arrow keys.
2015-07-19 22:07:21 -04:00
Matthias Clasen
bd41c92b28 trivial: Some reformatting 2015-07-19 17:39:23 -04:00
Matthias Clasen
5b5b4de495 places sidebar: Remove pointless code
No need to set or unset adjustments explicitly.
2015-07-19 17:37:39 -04:00
Matthias Clasen
f263c11ce8 spin button: Add Home and End as key bindings
Make these go to the lower/upper boundary of the adjustment, like
Ctrl-PageUp/PageDown already do.
https://bugzilla.gnome.org/show_bug.cgi?id=309300
2015-07-19 17:17:53 -04:00
Matthias Clasen
e7fe194b2d GtkWidget: Add custom font map support
This allows to use a custom font map for parts of the widget
hierarchy - this can be used for application-specific fonts.

https://bugzilla.gnome.org/show_bug.cgi?id=751812
2015-07-19 16:58:43 -04:00
Matthias Clasen
c9a2e4c0a3 font chooser: Add placeholder text to preview entry
This will make things more understandable if an application
sets an empty preview text.
https://bugzilla.gnome.org/show_bug.cgi?id=725551
2015-07-19 16:52:03 -04:00
Matthias Clasen
defc3d8cbc builder-tool: Don't strip border-width
Strictly speaking, this would only have to be special-cased inside
GtkDialog, but lets just skip it altogether.
2015-07-19 13:18:30 -04:00
Matthias Clasen
f881f37789 Fix csd decorations
By accident, commit b9b17c3c2a removed one line
that wasn't unused, but important for hiding close buttons on
dialogs. Bring it back.
2015-07-19 09:59:18 -04:00
Benjamin Otte
04883e72fa window: Set the type hint when it changes, not just on map()
There is no reason to wait until map() to reset a type hint on the GDK
window. Just set it when it changes.
2015-07-19 04:45:25 +02:00
Benjamin Otte
b0ac837271 window: g_object_notify() on type-hint change 2015-07-19 04:45:25 +02:00
Benjamin Otte
38a07cde75 window: Don't update type hint when it didn't change 2015-07-19 04:45:25 +02:00
Benjamin Otte
7a16039c2d window: Allow setting type hint on mapped windows 2015-07-19 04:45:25 +02:00
Benjamin Otte
8a238c7886 window: Don't keep 2 type hints
1. This confuses the code as it's using the old type hint with the new
type hint on GDK window creation

2. It only existed as a workaround for old code that directly accessed
window->type_hint which hasn't been possible since 3.0.
2015-07-19 04:45:25 +02:00
Benjamin Otte
8d3bcb6ef8 combobox: Simplify code
We don't add new children to the child's parent, we add them to ourself.
Because guess who a child's parent is?
2015-07-18 05:39:01 +02:00
Benjamin Otte
d071415d56 combobox: Remove unused header function functionality 2015-07-18 05:18:19 +02:00
Benjamin Otte
1ec7f435d8 combobox: Remove unused argument from private function 2015-07-18 05:18:19 +02:00
Matthias Clasen
c27b90cc79 Fix the build 2015-07-17 20:45:28 -04:00
Matthias Clasen
7fd307f881 Revert "GtkGrid: Add a few NULL checks"
This reverts commit e215db6da2.

We are actually requiring non-NULL out arguments here now.
2015-07-17 20:18:34 -04:00
Matthias Clasen
d8a40c4587 inspector: Avoid a NULL deref
Coverity pointed out that getting a class name requires
dereferencing the pointer, so only don't do it if it is NULL.
2015-07-17 19:52:52 -04:00
Matthias Clasen
0bb2567ff5 GtkWindow: Fix a use-after-free
We were printing a string in a warning after freeing it.
Also, fix an x/y typo that might cause popovers to be
mispositioned.
2015-07-17 19:19:24 -04:00
Matthias Clasen
a9ee745dc1 file chooser: remove an unused GError variable
Pointed out by coverity
2015-07-17 19:19:03 -04:00
Matthias Clasen
2eb39a3b7a inspector: Remove some dead code
Not sure what I was thinking here. Coverity pointed this out.
2015-07-17 18:47:39 -04:00
Matthias Clasen
ff86433ea1 inspector: Avoid a NULL deref 2015-07-17 18:42:24 -04:00
Matthias Clasen
ee43462d74 treeview: Add an explicit return for clarity
I believe that first_column can only ever be NULL here if
last_column is NULL too, in which case we'd exited already.
But coverity doesn't see that, so add an explicit exit.
2015-07-17 18:41:14 -04:00
Matthias Clasen
0ebcc56a77 tooltip: Remove unnecessary checks
Coverity uses these as clues to complain.
2015-07-17 18:40:37 -04:00
Matthias Clasen
361915628d list box: Remove unnecessary checks
Again, coverity takes these as clues to complain.
2015-07-17 18:40:11 -04:00
Matthias Clasen
6a9944cbc5 GtkLabel: Remove an unnecessary check
Coverity has the annoying habit of guessing backwards that
if we check the value here, it might be NULL earlier.
2015-07-17 18:39:14 -04:00
Matthias Clasen
e215db6da2 GtkGrid: Add a few NULL checks
Coverity complained about these.
2015-07-17 18:38:59 -04:00
Matthias Clasen
363e791d08 GtkActionHelper: Avoid null deref in debug code 2015-07-17 18:38:01 -04:00
Matthias Clasen
1b8d06da2d inspector: Check a return value
We don't care about the error here, but we were relying on
g_resources_get_info to zero the size even in case of error.
No need to do that, we can just check the return value. Plus,
it makes coverity happy.
2015-07-17 16:11:16 -04:00
Matthias Clasen
f960d4f486 inspector: Annotate a call whose return value we don't need
The way this code is written, we know that there is an item in
the hash table and the iter_next call will give it to us, so
no need to check the return value. Annotate the call to tell
coverity.
2015-07-17 16:11:16 -04:00
Matthias Clasen
8ba55d80fc gtkicontheme: Check a return value
We were already looking at the error anyway, but rewriting things
this way lets coverity see the light.
2015-07-17 16:11:16 -04:00
Matthias Clasen
91b147622b gtkbuilderparser: Add some assertions
Add some assertions that things are non-NULL when we know they
are, so that coverity gets it.
2015-07-17 16:11:16 -04:00
Benjamin Otte
6c862f229f css: Fix GtkCssChange enum
Previously, the (1<<31) value evaluated to the 64bit value
  0xFFFFFFFF80000000
instead of
  0x0000000080000000
Avoid this by explicitly casting the value to unsigned long long.

Also cast all values to unsigned long long to achieve consistency
and hopefully in the future get new values added the same way.
2015-07-17 22:06:16 +02:00
Benjamin Otte
dbb1830728 headerbar: Switch css positions on direction change 2015-07-17 19:13:09 +02:00
Matthias Clasen
9b81372ad9 file chooser: Improve popover positioning
We keep the popover vertically tied to the selected row, but pick
up the horizontal position from the click / touch.
2015-07-17 08:57:40 -04:00
Matthias Clasen
7627ed8000 places sidebar: Preserve ::populate-popup functionality
We "fix" this signal the same way we did for GtkEntry and
GtkTextView: slightly change the signature so that the passed
widget may be a container other than a GtkMenu, and add a
property to explicitly opt in to receiving the signal in
this case.
2015-07-17 08:57:39 -04:00
Matthias Clasen
33cc51d994 file chooser: Use a popover for the context menu
Use a popover for the context menu, and add a long press gesture
to allow opening it with touch.
2015-07-17 08:57:39 -04:00
Matthias Clasen
e08c5262b7 places sidebar: Use a popover for the context menu
Use a popover for the context menu, and add a long press gesture
to allow opening it with touch.
2015-07-17 08:57:39 -04:00
Matthias Clasen
02577ddb06 inspector: Avoid a gratitious use of g_strv_length
No need to count the strings first before iterating over them.
2015-07-16 23:42:55 -04:00
Matthias Clasen
1fb075dbca file chooser: Make bindings work in save entry
With the name entry being in the header bar now, we no longer
get bindings working by just letting the key event bubble up,
we have to explicitly apply them on key events that the save
entry is not handling.
2015-07-16 23:38:47 -04:00
Timm Bäder
c53bed3b39 GtkFileChooserButton: Don't update icon/label so often
They were updated in style-changed, causing the label to get set to
(None), then to the actual file name again a frame later, both of the
updates cause the GtkFileChooserButton to resize, possibly to the
minimal width, causing the layout to jump. Fix this by only updating
icon/label in style-updated when the icon theme actually changed, which
is the only case we care about here.

https://bugzilla.gnome.org/show_bug.cgi?id=752509
2015-07-17 05:36:44 +02:00
Timm Bäder
2902585518 gtkprintunixdialog: Set border_width to 0 2015-07-16 18:37:13 +02:00
Emmanuele Bassi
e259b2f30d Avoid O(n²) walking of string arrays
"Yo, we heard you like traversing NULL-terminated arrays to operate on
them, so we called g_strv_length() as the for condition, so you can
iterate the array while iterating the array."

Instead of making famed rapper and television producer Xzibit proud, we
should avoid calling g_strv_length() on an array while looping on the
array, to avoid quadratic complexity.

We do this in various places that deal with arrays of strings that we
cannot really guess are short enough not to matter — e.g. the list of
CSS selectors in the inspector, or the required authentication
information for printing.
2015-07-16 16:19:55 +01:00
Georges Basile Stavracas Neto
3b41daca78 placessidebar: show persistent drives when not showing Other Locations
Previous commits changes the behavior of GtkPlacesSidebar, as it stops
handling persistent devices and only manages mounted networks, XDG
directories and bookmarks.

By radically breaking the previous behavior, we may have trouble
since we provide no alternatives to that besides the private widget
GtkPlacesView.

Fix that by showing the persistent devices when not showing Other
Locations item.
2015-07-16 11:41:03 -03:00
Georges Basile Stavracas Neto
a39b8f67ba placessidebar: fix Connect to Server position
Commit 7db399d975 introduces
the Other Locations item, as well as some behavioral changes
to GtkPlacesSidebar. It, howevers, wrongly changes the section
of code that handles the Connect to Server item, with various
side effects depending on the environment setup.

Fix that by adding the Connect to Server at the right section
of code.
2015-07-16 09:37:56 -03:00
Benjamin Otte
3d2ead0fce headerbar: Get rid of get_path_for_child()
Instead, reorder CSS nodes.
2015-07-16 06:15:13 +02:00
Benjamin Otte
a039fd1699 headerbar: Finish widget setup before showing it. 2015-07-16 06:15:13 +02:00