Commit Graph

27306 Commits

Author SHA1 Message Date
Timm Bäder
14d376a2a6 sidebarrow: Remove useless size group
Nice try, but size groups don't work with invisible widgets anyway.
Invisible widgets request 0×0.

[reapplying after accidental reintroduction in the cloudproviders patch;
see https://bugzilla.gnome.org/show_bug.cgi?id=786123#c39]
2017-09-04 22:33:24 +01:00
Julius Härtl
8a940474d7 gtkplacessidebar: adapt libcloudproviders api rename
https://bugzilla.gnome.org/show_bug.cgi?id=786123
2017-09-04 11:27:31 -04:00
Daniel Boles
dc7952d2c6 HighContrast: basic port of emoji CSS from Adwaita
This is better than nothing: without specific CSS, the Chooser was too
large, the emoji were too small, and the buttons were generally ugly.

https://bugzilla.gnome.org/show_bug.cgi?id=786956
2017-09-04 10:58:50 -04:00
Daniel Boles
517b5360f4 Adwaita: proper colours for inactive emoji buttons
Use opacity to differentiate unselected/hovered/selected buttons. It had
assumed bg < border < fg colours, which may be false, as in Adwaita:dark

This also means we do not need to special-case for the backdrop state.

https://bugzilla.gnome.org/show_bug.cgi?id=786956
2017-09-04 10:58:42 -04:00
Daniel Boles
419ecc9e80 Adwaita: Make use of SASS syntax for emoji stuff
This makes the theme easier to maintain.

https://bugzilla.gnome.org/show_bug.cgi?id=786956
2017-09-04 10:58:28 -04:00
Daniel Boles
56027e079d Adwaita: Fix ineffective theming of switch slider
in a specific case, which was applying .slider as a class on the parent
switch, instead of correctly selecting on its child node named slider.

This makes the border on the outside of a switch in a selected listbox
row look better in the light variant. Since the code was never removed,
it was clearly meant to work, and making it work is a clear improvement.
2017-09-03 14:01:17 +01:00
Daniel Boles
70b61973fc HighContrast: Fix outdated name for headerbar box 2017-09-03 13:37:39 +01:00
Daniel Boles
80bd795969 Adwaita: Fix outdated name of selection-menu arrow 2017-09-03 13:37:24 +01:00
Daniel Boles
8dbb17e1f3 Toolbar: Clarify set_show_arrow() a bit more 2017-09-03 11:04:48 +01:00
Daniel Boles
66d63e4a47 Toolbar: Clarify how the arrow overflow menu works
The fact it affects the preferred size, and only works with ToolItems
that return a menu proxy item, was unclear unless deduced from other
sources, and this led to users thinking it was broken, for example:

https://stackoverflow.com/q/44644642/2757035

https://bugzilla.gnome.org/show_bug.cgi?id=787158
https://bugzilla.gnome.org/show_bug.cgi?id=787195
2017-09-03 10:58:58 +01:00
Daniel Boles
111ce61517 ToolItem: Add see-also from proxy setter to signal 2017-09-03 10:58:58 +01:00
Daniel Boles
ea73e0e0bd ToolItem: Annotate menu proxy item as nullable
It can be NULL. ::create-menu-proxy gave an example of when a NULL proxy
menu item could be useful, but the accessors did not annotate it as such.
2017-09-03 10:58:58 +01:00
Daniel Boles
ed782577e8 Adwaita: Fix colour mixing of emoji section button
when hovered, by using %, since SASS does not handle decimal mixes.
2017-09-02 16:01:39 +01:00
Matthias Clasen
434ece4a1c emoji chooser: No emoji in the search entry
Recursion is fun, but better avoided in the ui.

https://bugzilla.gnome.org/show_bug.cgi?id=786960
2017-09-02 08:48:47 -04:00
Matthias Clasen
172c6c1949 entry: Consider input hints for Emoji support
Don't show "insert emoji" in the context menu if input
hints indicate that Emoji input is not useful.
2017-09-02 08:48:07 -04:00
Matthias Clasen
f3df85e528 Add input hints for Emoji input
Allow hinting input methods about whether Emoji support is
useful or not.
2017-09-02 08:48:00 -04:00
Matthias Clasen
f0b4b45b76 emoji chooser: Avoid a crash
The emoji chooser gets disposed already, because it is attached
to the toplevel as a popover. Doing it again when the object data
is cleared is leading to a crash.

https://bugzilla.gnome.org/show_bug.cgi?id=787103
2017-09-01 19:53:11 -04:00
Mohammed Sadiq
8d0dc64e61 emoji-chooser: fix subsequent scroll
Event handlers on scroll window should only be run once the widget
is shown.

https://bugzilla.gnome.org/show_bug.cgi?id=786964
2017-09-01 18:31:40 -04:00
Daniel Boles
38b8b3ce1d Entry: Set tooltip text on icon for emoji chooser
https://bugzilla.gnome.org/show_bug.cgi?id=786885
2017-09-01 18:18:45 -04:00
Daniel Boles
d9b5fd357f ComboBox: Dodge possible surplus disconnects
in case anyone connected any other signal on the model to this ComboBox.
2017-09-01 20:17:11 +01:00
Daniel Boles
423cd8e73e ScrolledWindow: Dodge possible surplus disconnects
In case the outgoing Adjustment for whatever reason has other handlers
referring to this SW, be sure to avoid disconnecting any but our own.
2017-09-01 16:28:44 +01:00
Daniel Boles
3ff04099a7 ComboBox: Remove pointless signal ID member fields
We don’t need to store these for disconnection, as we can just use
g_signal_handlers_disconnect_by_data(). Also, merge redundant ifs.
2017-09-01 16:28:44 +01:00
Daniel Boles
85ca68b1c2 ComboBox: Clean up handler disconnection some more 2017-09-01 16:28:44 +01:00
Daniel Boles
5dc5576e14 ScrolledWindow: Fix non-disconnection of handlers
• Use disconnect_by_data() to catch both _adjustment_changed() and now
  _adjustment_value_changed(), as the latter had been missed until now.

• Also disconnect from indicator_value_changed(), which was not done in
  destroy() due to indicator_reset() and remove_indicator() disagreeing.

https://bugzilla.gnome.org/show_bug.cgi?id=775074
2017-08-31 23:17:03 +01:00
Timm Bäder
64d05b5dc6 scrolledwindow: Properly remove scrollbars
Instead of keeping an extra ref, then unparent+destroy+unref, don't keep
an extra ref and just unparent the scrollbar when appropriate.
2017-08-31 22:59:40 +01:00
Daniel Boles
f0522e9944 Window: Connect screen signals properly in init()
Do not connect to get_settings_for_screen() if we have no screen…

Use g_signal_connect(), not connect_object(), to match how set_screen()
makes these same connections, and how finalize() already disconnects.

https://bugzilla.gnome.org/show_bug.cgi?id=705640
2017-08-31 20:23:00 +01:00
Daniel Boles
169e5502d1 FileChooserWidget: Remove an unused #include 2017-08-31 20:05:32 +01:00
Daniel Boles
794c0946a5 Entry: Rename int helper to gtk_entry_clear_icon()
It was called gtk_entry_clear(), which was unnecessarily vague.
2017-08-30 21:12:56 +01:00
Daniel Boles
12d96f27d3 Entry: Fix Shift-click → extend/truncate selection
Since the move from button-press to gesture events, Shift-clicking did
not work to start a selection (from none) or truncate an existing one.

This was due to the code being copy-pasted around and some logic being
broken in the process. This makes both of those work as they should, by
shuffling it again so the end result is the same as before. Highlights:

(1) ::button-press if extending due to a single press would call
set_positions(tmp_pos, tmp_pos), which is what made the Shift+click to
create a selection work. That was lost. Add it back to make that work.

(2) ::button-press in the “Truncate current selection” branch would not
execute all the stuff around “extend_to_left”, as that was the else
case. So, set extend_selection = FALSE so we skip over that later on.

(3) BUT! This Truncate case never fired because it was in the else
branch of if (in_selection())! Of course, it must be in the true branch.

(4) The IM context was not reset if the Shift-click occurred within an
existing selection, only if it did not. In ::button-press this was the
first thing done if extending a selection, regardless. Make it so again.

https://bugzilla.gnome.org/show_bug.cgi?id=780750
2017-08-30 18:25:00 +01:00
Matthias Clasen
beb7bba3ce Avoid empty space in the emoji chooser
We need to hide the empty flow boxes as well, to avoid
spacing between them.

https://bugzilla.gnome.org/show_bug.cgi?id=786966
2017-08-30 14:25:14 +01:00
Daniel Boles
9f1d57e032 PlacesSidebar: Reuse strings, mark for translation
The new menu items were not marked for translation, had no mnemonics,
and were not title-cased. Reuse the strings that we already had for the
buttons shortly down the file, and mark these for translation.

https://bugzilla.gnome.org/show_bug.cgi?id=786123
2017-08-29 20:09:11 +01:00
Nelson Benítez León
07320200d1 textview: fix bug on DnD displaced limits of selection
The fix of commit f2fd655754
should be confined to DnD coords only, because otherwise
it causes the start and end of the selection to be displaced.

https://bugzilla.gnome.org/show_bug.cgi?id=785736
2017-08-29 19:12:14 +01:00
Daniel Boles
afd624bf4b TextView: :border-width broke window→widget coords
Do the converse of commit bd7c87c762 so
that a TextView with Container:border-width > 0 does not get its handles
and magnified region shifted up/left from where they should be.

https://bugzilla.gnome.org/show_bug.cgi?id=786986
2017-08-29 19:04:26 +01:00
Daniel Boles
18a6c5c4c6 Expander: Don’t set event_window over whole widget
realize() gave the event_window the allocation of the whole widget. This
was wrong; it should be that of the title_gadget, as in size_allocate().

This broke expanders in which :expanded is TRUE before showing: Input
over the entire widget was sent to the title, making the child unable to
receive it. Clicking the child unexpectedly collapsed it. Once expanded
again, things fixed themselves as size_allocate() fixed the event_window
alloc. So, queuing a reallocate or resize after show() was a workaround.

Fix by giving event_window the allocation of the title_gadget, to match
what size_allocate() does. That is symmetrical and just plain correct.

https://bugzilla.gnome.org/show_bug.cgi?id=774134
2017-08-29 18:47:33 +01:00
Debarshi Ray
a827e92226 GtkBuilder: Prefer "type-func" over "class" when looking for the GType
https://bugzilla.gnome.org/show_bug.cgi?id=786932
2017-08-29 15:42:56 +02:00
Daniel Boles
c85f34b6fc LevelBar: Really fix underallocation of blocks
Themes should not enforce min sizes on blocks in continuous mode; in
this case, the filled block should be as large as it needs to be to
reflect the current value, and no larger or smaller than that. So, the
fact that the minimal size was selected on just levelbar block is wrong:
we should also require the levelbar.discrete class to apply min sizes.

The widget should enforce whatever correct minimum size results from the
above fix, by reapplying commit 78b4885fe8

Except: we should not allocate/draw the filled block if the value is 0,
as in this case, the LevelBar should be empty, not have a min-size fill.

https://bugzilla.gnome.org/show_bug.cgi?id=783649
2017-08-29 00:03:47 +01:00
Daniel Boles
bd7c87c762 TextView: Fix gesture coords with :border-width >0
Container:border-width caused the x/y coords converted to iters to be
offset inwards by that width, breaking positioning/selecting by gesture.

So, subtract :border-width in widget_to_text_window_coords(). This fixes
gesture positions, & plays fine with :margin & CSS margin/border/padding

N.B.: This is not to endorse :border-width. It’s gone in GTK+ 4 & weird
on a TextView: it’d be more intuitive to – if you must! – set it on the
TV parent. Really, please just use CSS instead. Still, it’s easy to fix.

https://bugzilla.gnome.org/show_bug.cgi?id=759725
2017-08-28 22:28:49 +01:00
Daniel Boles
669e8c4de5 Entry: Handle :show-emoji-icon becoming false
Disconnect the now-unwanted signal handler, and hide the icon.

https://bugzilla.gnome.org/show_bug.cgi?id=786940
2017-08-28 20:52:29 +01:00
Daniel Boles
6094caf984 Entry: Drop redundant typecasts
https://bugzilla.gnome.org/show_bug.cgi?id=786940
2017-08-28 20:52:26 +01:00
Daniel Boles
fccf19b905 Entry: Only open emoji picker on 2ndary icon click
We hijack the secondary icon for the emoji picker, but the handler for
::icon-press did not check the pressed icon and opened it for either.

https://bugzilla.gnome.org/show_bug.cgi?id=786938
2017-08-28 20:31:02 +01:00
Daniel Boles
1fd834c54d ComboBox: Don’t redundantly show() scrolled_window
It and its child were already show()n in list_setup().
2017-08-28 20:01:57 +01:00
Daniel Boles
1f1fdfe757 ComboBox: Fix wrongly matched signal disconnect()s
Various disconnections had the wrong flags and/or data, so we failed to
disconnect a pile of signals, shown by 0 returned by the disconnect_*()
functions. Fix this, and use the nicer disconnect_by_*() while here.
2017-08-28 20:01:57 +01:00
Daniel Boles
1301723905 Revert "combobox: remove superfluous GTK+ grabs"
This reverts commit 46b4e5d388.

Apparently these weren’t so redundant, because their removal introduced
at least 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 in a modal window. It may also have caused (even more!) stuck grabs.

https://bugzilla.gnome.org/show_bug.cgi?id=738387
https://bugzilla.gnome.org/show_bug.cgi?id=776793
2017-08-28 20:00:59 +01:00
Daniel Boles
c789bf7718 ComboBox: Really set list-mode popup transient-for
set_transient_for(toplevel) was only called in list_setup(). It was easy
to make a test showing a NULL :transient-for instead of the correct one.

So, move the call from list_setup() to popup_for_device(). Also do that
for window_group_add_window(), which means not calling it redundantly.

(I tried using a ComboBox:parent-set handler, but the Inspector’s CB
didn’t like that: it calls popup_for_device() twice and closes on button
release. Anyway, using popup() is much more concise than a new handler.)
2017-08-28 20:00:17 +01:00
Daniel Boles
70534de382 ComboBox: List-mode popup must open on CB’s screen
The screen for the list-mode popup_window was only being set in
set_popup_widget(), i.e. when changing modes, so if the ComboBox was
moved to a different screen later, the popup would appear on the
original one, which is wrong.

Worse, this (somehow) broke opening some combos in the Inspector.

Fix this by moving the call to set_screen() to popup_for_device(), so
the popup_window is put on the correct screen each time around.

https://bugzilla.gnome.org/show_bug.cgi?id=468868
https://bugzilla.gnome.org/show_bug.cgi?id=786771
2017-08-28 19:33:54 +01:00
Julius Härtl
f68421376b gtkplacessidebar: remove oversight of old code
https://bugzilla.gnome.org/show_bug.cgi?id=786123
2017-08-28 08:13:12 +02:00
Carlos Garnacho
26d8a6dfba menu: Avoid cancelling the menu on GTK+ grabs inside the GtkMenu
Allows again sliders as menuitems, broken by commit 9b032073.

https://bugzilla.gnome.org/show_bug.cgi?id=786029
2017-08-27 20:43:11 +01:00
Daniel Boles
d1d8658898 PlacesSidebar: Avoid warning about unused variable
end_icon is only used if HAVE_CLOUDPROVIDERS is defined, so only declare
it under the same condition.

https://bugzilla.gnome.org/show_bug.cgi?id=786123
2017-08-27 15:37:34 +01:00
Daniel Boles
53e0bd91e6 SidebarRow: need config.h for HAVE_CLOUDPROVIDERS
https://bugzilla.gnome.org/show_bug.cgi?id=786123
2017-08-27 15:37:34 +01:00
Matthias Clasen
45b54041ed emoji: Use the right gettext domain
Otherwise, strings are not translated.

https://bugzilla.gnome.org/show_bug.cgi?id=786841
2017-08-26 10:26:47 -04:00