Commit graph

24 commits

Author SHA1 Message Date
Maximiliano Sandoval R
883a3d44ab sharing-networks: Make network row activatable 2023-10-23 13:37:52 +00:00
velsinki
efc595cccd sharing: Fix visual bug for active indicators
The switch for the current network was only updated to TRUE after a
network change. However, if a new network was not enabled, the switch
should be set to FALSE. This is now properly handled.

Furthermore, the Off/Enabled/Active indicator was also inconsistent
after network changes due to the is_visible check failing sometimes,
even after changing to an already enabled network. Because the actual
current network state is now better tracked, we can just check the state
of the switch instead.
2023-05-05 09:35:01 +00:00
velsinki
e61b270fb7 sharing: Fix network row visible name bug
In `cc_sharing_networks_new_row`, the `network_name` is not being set to
the new row, but to `self->current_row`. This is incorrect behavior,
as it leaves the new row without any title, and overwrites the title of
the current row incorrectly to the last network entry in the enabled
networks list. This fix correctly sets the name to the new row instead.

This problem is at least discussed in #2318 (point 3) and causes some
confusion in #2299 as well.
2023-04-03 08:46:36 +00:00
Maksym Hazevych
5b988a6943 Replace all occurrences of 'gtk_widget_hide'
Replace all occurrences of 'gtk_widget_hide(smth)' with
'gtk_widget_set_visible(smth, FALSE)'.
2023-03-29 14:26:55 +13:00
Maksym Hazevych
d831e5cb48 Replace all occurrences of 'gtk_widget_show'
Replace all occurrences of 'gtk_widget_show(smth)' with
'gtk_widget_set_visible(smth, TRUE)'.
2023-03-29 14:26:55 +13:00
velsinki
d766a0c0c6 sharing: Disable AdwActionRow markup for networks
Network names have many allowed characters, among which `&`, `<`, and
`>`. These are problematic for Pango markup. By default, AdwActionRow
has markup enabled for its title. We could escape strings at every
`adw_preferences_row_set_title` call, but this might be easy to forget
in the future. Instead, let's disable markup altogether for these rows.
2023-03-24 00:56:03 +00:00
Alessandro Bono
9d2844e02f sharing: Set active property instead of state
The ability to tweak the state property was mainly introduced in
order to implement delayed state change via the state-set signal.
Since GTK 4.9.3[1] the active and state properties are no more
interchangeable.

[1] https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5442
2023-03-03 18:16:57 +00:00
Felipe Borges
294156c0f9 Drop most uses of deprecated gtk_style_context_add/remove_class
GtkStyleContext will be deprecated in gtk 4.10.
https://docs.gtk.org/gtk4/class.StyleContext.html

This preserves code blocks where additional GtkStyleContext operations
were used, such as gtk_style_context_save/restore.
2023-01-05 18:55:51 +00:00
Lukáš Tyrychtr
af197cb813 Add missing a11y labels 2022-05-31 21:08:44 +00:00
Georges Basile Stavracas Neto
f043ca3680 sharing: Port to GTK4
Again, it was easier to just switch some of the code to use
AdwActionRow, and that's what I've done in this commit.
2021-12-14 22:34:21 -03:00
Robert Ancell
10e73b733b sharing: Connect signals with g_signal_connect_object in swapped form 2020-03-30 16:18:49 +13:00
Robert Ancell
90c7311664 sharing: Make .ui filename match the .c filename 2019-09-09 21:58:00 +00:00
Robert Ancell
c058f15d10 sharing: Don't use gtk_widget_show_all
It is removed in GTK+ 4
2018-10-18 01:18:57 +00:00
Robert Ancell
a30f660db9 sharing: Use g_auto for variables 2018-06-03 01:11:17 +00:00
Robert Ancell
394797025f sharing: Replace GObject boilerplace with G_DECLARE_TYPE 2018-06-01 21:21:05 +00:00
Jonathan Kang
00a74afc20 sharing: set end margin for labels in Networks list box
Currently if a network connection's name is long enough, there will
be no space between the name label widget and the switch button widget
next to it.

Fix that by setting the end margin of label widget as 6 to keep some
space between those two widgets.
2018-04-26 16:32:25 +00:00
Benjamin Berg
c2f601a9d4 Move common panel code from shell/ to panel/common
This creates a new static library called libwidget which the shell links
against.
2018-04-17 15:26:59 +02:00
Felipe Borges
afbdddc2ed sharing: properly resize listbox rows
https://bugzilla.gnome.org/show_bug.cgi?id=767646
2018-01-17 23:54:33 -02:00
Rui Matos
7121f03564 sharing: Prevent an endless loop and resulting stack overflow
We need to block ourselves around the gtk_switch_set_active() call in
the error path, when we can't speak to the sharing dbus service, or we
end up in an endless loop since we're the ::state-set handler.

https://bugzilla.gnome.org/show_bug.cgi?id=739886
2014-11-13 11:28:24 +01:00
Bastien Nocera
bd531b477e sharing: Update for list box API change 2014-06-26 16:00:45 +02:00
Bastien Nocera
5eca0f898c sharing: Add maximum height for the networks list box 2014-06-26 16:00:45 +02:00
Bastien Nocera
73f3e17bee sharing: Use listbox header helper 2014-06-26 16:00:27 +02:00
Bastien Nocera
ff8a8a6baa sharing: Update for sharing plugin API changes
See https://bugzilla.gnome.org/show_bug.cgi?id=732218
2014-06-25 16:21:21 +02:00
Bastien Nocera
cbeba7c6bf sharing: Add per-network sharing
Using the new D-Bus service from gnome-settings-daemon.

https://bugzilla.gnome.org/show_bug.cgi?id=727580
2014-06-24 11:35:30 +02:00