Commit Graph

49238 Commits

Author SHA1 Message Date
Timm Bäder
b3f4da0439 applicationwindw: Don't leak show-help-overlay action 2017-10-06 18:15:31 +01:00
Timm Bäder
183c23d710 widget-factory: Don't leak GPropertyAction instances 2017-10-06 18:15:25 +01:00
Daniel Boles
fa04eb26d7 HC: Add border/hilight when hovering flat buttons
The border and icon highlight are useful feedback that was defeated by
CSS precedence. It worked for .titlebuttons due to their implementation,
but the same was not true for custom .flat buttons. This makes it so.

https://bugzilla.gnome.org/show_bug.cgi?id=788580
2017-10-06 02:37:07 +01:00
Daniel Boles
61137ae163 HC: Flat titlebuttons became non-flat in backdrop
When the window was backdropped, they suddenly regained their border.
This was clearly not intentional or of any practical use to anyone.

Shuffle around some selectors so that the backdrop ones do not override
the flat ones and make the borders magically reappear when backdropped.

Note that, whereas standard titlebuttons get the border on :hover, other
.flat buttons in the headerbar do not. That should probably be fixed too

https://bugzilla.gnome.org/show_bug.cgi?id=788580
2017-10-06 02:36:52 +01:00
Daniel Boles
7fc09f18a3 ComboBox: Don’t let modes disconnect each other
…from priv->button. My refactor to g_signal_disconnect_by_data()
included this widget, when I shouldn’t have as both modes use it.
This e.g. broke opening a CB by keyboard that was currently in menu
mode, if it had been in list mode initially (e.g. due to the theme).

Fix by moving to disconnect_by_func() and only removing in each mode’s
destroy() method the signals that it set on the button in its setup().

https://bugzilla.gnome.org/show_bug.cgi?id=788577
2017-10-06 01:40:42 +01:00
Daniel Boles
6c3d17b867 HighContrastInverse: Make window borders visible
They were hard-coded to a transparent black, but that is our bg colour
in HC Inverse, so windows stacked on top of each other or a dark
background blended together into a mush.

Fix this by making the $_wm_border* colours relative to the fg colour,
so that HighContrastInverse gets borders that are transparentised white.

https://bugzilla.gnome.org/show_bug.cgi?id=788575
2017-10-06 00:38:13 +01:00
Daniel Boles
3a0ea4e0d2 HC: Fix MessageDialog’s rounded bottom borders
A missing decoration selector meant that we got a solid black background
behind the rounded corners of the dialog.

Copy the equivalent code from Adwaita, including nicely rounding the
focus outline too (& sorry, but this needs more newlines to be readable)

https://bugzilla.gnome.org/show_bug.cgi?id=788574
2017-10-06 00:25:58 +01:00
Daniel Boles
d9df5dfa74 HighContrast: Fix titlebar containing >1 headerbar
by migrating the relevant code from Adwaita, to dodge unwanted doubling
up of the bottom border and such.

It also hopefully still encompasses whatever commit
b4371728de was trying to do; certainly, it
retains the resolution of the main bug/patch that one was attached with.

https://bugzilla.gnome.org/show_bug.cgi?id=769877
2017-10-05 21:49:11 +01:00
Daniel Boles
8abdbfee16 HC: Copy working tooltip code from Adwaita & tweak
There were various problems, like only selecting on .tooltip and not the
widget node tooltip, not being specific enough for tooltip.csd, etc. So,
specific theming was absent, and default popup window styles got applied

This commit copies in the better working tooltip CSS from Adwaita, but
applies a couple of changes to make it work better in the HC themes:
 • Reduce the transparency of the tooltip, so we achieve higher contrast
 • Drop the black text-shadow, as it is not useful on this more black bg

Note: we may then need to re-add some of this to the .tooltip class. But
it is unclear what needs done there. While Adwaita is not doing it, we
are better not to confuse by keeping it in HC only; we should try to be
as close as possible, to make it easier for HC to keep up with Adwaita.

https://bugzilla.gnome.org/show_bug.cgi?id=769879
2017-10-05 19:41:00 +01:00
Timm Bäder
acab79040a switch: Fix int/double comparison
We get a double coordinate.
2017-10-05 18:50:12 +01:00
Timm Bäder
070af44fc7 appchooserdialog: Remove unused macro 2017-10-05 18:50:12 +01:00
Timm Bäder
18b8b2b8e8 combobox: Remove unneeded queue_resize call
The remove/add/set_parent/unparent calls in there already do the
necessary work.
2017-10-05 18:50:12 +01:00
Xavi Ivars
ee5b762246
[l10n] Updated Catalan (Valencian) translation 2017-10-05 18:06:25 +02:00
Daniel Boles
34cd1e3e5e ComboBox: list: Don’t leak path on expand/collapse
Determining that we clicked on the expander means that we had a valid
path, so we still need to free that, even though we’re not selecting it.

https://bugzilla.gnome.org/show_bug.cgi?id=788505
2017-10-05 01:33:22 +01:00
Daniel Boles
b0e18d676e HighContrast: Correctly select window decoration
We need

    .window-classes decoration

but within the decoration parent selector, we were doing
&.window-classes, which gave us

    decoration.window classes

We need to fix this by selecting on .window-classes &

https://bugzilla.gnome.org/show_bug.cgi?id=788496
2017-10-05 00:27:39 +01:00
Daniel Boles
512a33fee1 updateiconcache: Avoid confusing loop construct
n_attach_points is the result of g_strv_length(): the index at which the
string vector ends in NULL. So by definition, when i == n_attach_points,
string[i] == NULL, and there is no need to check for the latter. The
fact that we did appears to confuse static analysers, as the dereference
and index check were inverted from what would normally be safe. We could
reverse them, but we may as well just remove the unnecessary NULL check.

https://bugzilla.gnome.org/show_bug.cgi?id=788458
2017-10-04 22:55:54 +01:00
Colomban Wendling
367ff368f2 Enter submenus when activating their parent item
This gives consistent behavior with e.g. Qt, Mozilla's suites and
LibreOffice (with non-truly native backends like "gen" and "gtk",
but unlike "gtk2" and "gtk3" ones that probably use true GTK menus).

This behavior is expected by at least some accessibility users, and
it seems good to behave like other common applications and toolkits
in this area.  There should be no issue in doing so either for current
users, as it only enters the submenu instead of not doing anything.

https://bugzilla.gnome.org/show_bug.cgi?id=778811
2017-10-04 22:48:21 +01:00
Daniel Boles
a8df958c07 ComboBox: Don’t pile up ::grab-broken handlers
It was connecting a new handler to do the same thing every time it
popped up, never disconnecting between. Just connect once in init().
2017-10-04 22:48:21 +01:00
Daniel Boles
6c5b284615 ComboBox: list: Make the popup_window modal
This seems to fix 2 bugs in list-mode ComboBoxes: failure to close the
popup upon clicking out of it, and failing to receive mouse input in the
popup of a CB contained within a modal parent window.

https://bugzilla.gnome.org/show_bug.cgi?id=738387
https://bugzilla.gnome.org/show_bug.cgi?id=776793
2017-10-04 21:53:53 +01:00
Daniel Boles
b92234be08 Revert "Revert "combobox: remove superfluous GTK+ grabs""
This reverts commit 1301723905.

This only appeared to fix the two bugs it linked because, rather than
being superfluous, the GTK+ grabs resulted in effectively having *none*,
or something, and could cause a critical when closing during a scroll.

This also reverts commit b9989e554b, which
depended on the above.

See next commit, which *should* properly fix what this one claimed to…

https://bugzilla.gnome.org/show_bug.cgi?id=787274
2017-10-04 21:53:53 +01:00
Daniel Boles
a20ff44b09 ComboBox: list: Fix expanding/collapsing tree rows
On clicking release, we call TreeView.get_path_at_pos() &, if we hit a
row, select it (if sensitive) & close the popup. But this alone does
not account for clicks on the expanders within the TreeView, so in
addition to expanding/collapsing, clicking them would close the list.

Check if the click is in the cell_area() & thus “excluding surrounding
borders and the tree expander area” but still including the background
(which TreeView.is_blank_at_pos() doesn’t); if TRUE, don’t select/close.

The popup doesn’t always resize enough… so there’s still breakage here.
The XXX comment on TreeView requests in list_position() may be relevant
to this. But at least this drags such CBs one step closer to adequacy:
expanding by mouse now works ~no worse~ than by keyboard already did.

https://bugzilla.gnome.org/show_bug.cgi?id=788505
2017-10-04 21:53:53 +01:00
Daniel Boles
628ff776d1 ComboBox: rm pointless ScrolledWindow.set_policy()
This just set hpolicy to what it already was and then called
set_policy() with the same two arguments again, which did nothing.
2017-10-04 21:53:53 +01:00
Georges Basile Stavracas Neto
73155e3988 display-x11: Unset tiled state if _GTK_EDGE_CONSTRAINTS is supported
Commit c415bef5de introduced support for the new _GTK_EDGE_CONSTRAINTS
atom. If the compositor supports that atom, however, we were always
setting the tiled state, even if no actual tiling information is
available, where the correct action is to completely remove any traces
of the tiled state.

Fix that by correctly removing the tiled state when compositor supports
_GTK_EDGE_CONSTRAINTS Xatom.

https://bugzilla.gnome.org/show_bug.cgi?id=788516
2017-10-04 15:33:15 -03:00
Georges Basile Stavracas Neto
7ab6dd64de theme: Fix Adwaita headerbars
We were not detecting correctly the cases where we should have
a rounded or a squared headerbar.
2017-10-04 14:46:02 -03:00
Daniel Boles
77401118c2 Adwaita: Fix typo .backgrounf => .background 2017-10-04 15:43:21 +01:00
Matthias Clasen
e72d54c8a7 3.22.24 2017-10-04 08:09:26 -04:00
Matthias Clasen
899cfb3c50 Fix several issues with resizing
Some of the border windows were not placed correctly.

Patch by Jan Steffens.
2017-10-04 07:35:45 -04:00
Matthias Clasen
223a709403 wayland: Fix a typo
We were not setting the right tiling hint in some cases.

Patch by Jan Steffens.
2017-10-04 07:35:45 -04:00
Daniel Boles
b9989e554b ComboBox: Don’t try to remove grab on NULL device
gtk_device_grab_remove() quite rightly expects a non-NULL GdkDevice, and
we already have a branch ensuring that, into which we can move this call
2017-10-04 12:23:49 +01:00
Daniel Boles
fa4d814462 TreeMenu: Remove accidentally duplicated doc lines
Not that it actually matters, as this is not public anymore, but this
was done accidentally. Also, sync a property description to ComboBox.
2017-10-04 12:03:55 +01:00
Daniel Boles
3783934436 testcombo: Test grid :row- and :column-span-column
Ditch two items that were white and so weren’t visible on our standard
theme anyway, and use the new space to test extra grid-mode properties.

Note that if we do this then, as before, we set the ListStore on the
ComboBox before appending to it, that produced runtime warnings like:

Gtk-CRITICAL **: gtk_menu_attach: assertion 'left_attach < right_attach' failed

I didn’t look into that yet, but it may indicate that attaching items
vs. recognising their spans don’t occur in the correct order. For the
purposes of testing this, I just create the CB after filling its model.
2017-10-04 11:04:52 +01:00
Daniel Boles
4163a53630 ComboBox|TreeMenu: Slightly clarify wrap-width doc 2017-10-04 10:21:18 +01:00
Daniel Boles
7559eaf5f9 ComboBox|TreeMenu: Clarify :row|column-span-column
ComboBox and TreeMenu warned in the doc for :row-span-column that the
value must not exceed :wrap-width, but :wrap-width does not interact
with the number of rows; it’s the :column-span-column that’s relevant.

Also: Warn that spans must be > 0 for rows too, and that column spans <=
:wrap-width are also not useful for items at menu column positions > 0.

Finally, refer to items having spans, not values, as we were already
talking about values in the model (and rows in the menu).
2017-10-04 10:21:01 +01:00
Matthias Clasen
a5c2472941 3.22.23 2017-10-03 22:40:44 -04:00
Marco Trevisan (Treviño)
c91a4f31f0 HighContrast: set min-height for headerbars
https://bugzilla.gnome.org/show_bug.cgi?id=784562
2017-10-03 22:26:36 -04:00
Marco Trevisan (Treviño)
b4371728de HighContrast: don't select .titlebar when is an headerbar
https://bugzilla.gnome.org/show_bug.cgi?id=784562
2017-10-03 22:26:36 -04:00
Georges Basile Stavracas Neto
79bf5b8592 window: Add individual CSS classes based on edge constraints
The last touch on this patch series is making GtkWindow able to
selectively adjust various UI details based on the different
tiled edges. The main driver here is that we don't want to show
shadows on edges that are constrained.

This patch adds the necessary code to do that, while still
maintaining compatibility with the old ways.

https://bugzilla.gnome.org/show_bug.cgi?id=783669
2017-10-03 20:06:46 -03:00
Georges Basile Stavracas Neto
c415bef5de x11: Add support for _GTK_EDGE_CONSTRAINTS atom
Following the previous patch, where edge constraints support
was added to the Wayland backend, this patch introduces the
necessary code to handle the _GTK_EDGE_CONSTRAINTS atom from
X11 backend.

https://bugzilla.gnome.org/show_bug.cgi?id=783669
2017-10-03 20:06:46 -03:00
Georges Basile Stavracas Neto
3bae80dfc1 wayland: consider edge constraints in surface configuration
Now that GTK windows have the ability to properly handle
per-edge tiling constraints, this patch extends GTK's
internal Wayland protocol to have a proper enum with the
relevant edge data.

Once this approach is validated, we can think of upstreaming
this work as an official Wayland protocol extension.

https://bugzilla.gnome.org/show_bug.cgi?id=783669
2017-10-03 20:06:46 -03:00
Georges Basile Stavracas Neto
d73c49ecef window: handle tiled edges separately
GTK windows don't have their tiling states really
hooked into the client-side decoration code, and
the only effect it has is disabling the resizing
edges.

With the introduction of per-edge tiling information,
we are backed by much more precise data on how the
window manager wants the app to behave.

This patch, then, fixes GtkWindow to take into account
per-edge tiling information. For compatibility purposes,
the previous tiled field was kept, and thing will just
continue working if no edge information is supplied.

https://bugzilla.gnome.org/show_bug.cgi?id=783669
2017-10-03 20:06:46 -03:00
Georges Basile Stavracas Neto
f1a3bc2f2c gdk: introduce edge constraint states
These states will be consumed by GtkWindow in order to
have better edge management on tiling situations. Their
values are supplied by the compositor, and will be send
through and X11 Atom or a Wayland protocol extension.

https://bugzilla.gnome.org/show_bug.cgi?id=783669
2017-10-03 20:06:43 -03:00
Daniel Boles
66767adc63 widget-factory: Demo different Frame border-styles
This shows not all, but the interesting/less predictable styles, and
the ones that correspond to the :shadow-types that were here before.
2017-10-02 20:22:33 +01:00
Daniel Boles
93fc2a8edd Revert "widget-factory: Usefully demo Frame shadow types"
This reverts commit 15a3747406.

There is a way to get different kinds of borders: it's CSS. It's better
to keep the 4 Frames and demo the different styles we can do using CSS.
2017-10-02 19:50:06 +01:00
Daniel Boles
1d80453e47 Frame: Enhance CSS docs
Note optional .flat class and that the old shadow types are replaced by
CSS border-style et al.; quote names of nodes & classes for readability.
2017-10-02 19:50:06 +01:00
Matthias Clasen
364559b789 3.22.22 2017-10-02 12:45:24 -04:00
Daniel Boles
142ef42d22 Widget: Fix obvious copypasto in set_mapped() doc 2017-10-01 20:23:59 +01:00
Daniel Boles
82a9331144 docs: css-properties: Fix wrongly repeated colour 2017-09-29 18:13:44 +01:00
Sam Thursfield
d6547060e9 flowbox: Fix annotation for GListModel binding callback
The GtkFlowBoxCreateWidgetFunc type lacked GObject Introspection
annotations for its arguments. This made gtk_flow_box_bind_model()
unusable from Python as the callback function would be passed useless
values.

The annotations that I've added match those of the similar callback
type GtkListBoxCreateWidgetFunc.

https://bugzilla.gnome.org/show_bug.cgi?id=780758
2017-09-27 13:45:08 +02:00
Daniel Elstner
a57630b30c gdk-wayland: Do not leak dummy 1x1 surface on every draw
When using EGL, neither leak nor re-create the dummy 1x1 Cairo
surface every time gdk_wayland_window_ensure_cairo_surface()
is called.

https://bugzilla.gnome.org/show_bug.cgi?id=775126
2017-09-26 21:15:21 +02:00
Daniel Boles
701f82d1c3 Button: Annotate set_image() argument as nullable
Passing NULL is valid and results in the image child being unset/removed
2017-09-24 22:20:34 +01:00