Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion data/Indicator.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
/*
* SPDX-License-Identifier: GPL-3.0-or-later
* SPDX-FileCopyrightText: 2023 elementary, Inc. (https://elementary.io)
* SPDX-FileCopyrightText: 2025 elementary, Inc. (https://elementary.io)
*/

quicksettings tattlebox box {
padding: 0.666rem; /* 6px */
}

quicksettings scalebox,
quicksettings .togglebox {
padding: 0.666rem; /* 6px */
Expand Down
1 change: 1 addition & 0 deletions po/POTFILES
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ src/Widgets/PreventSleepToggle.vala
src/Widgets/RotationToggle.vala
src/Widgets/SessionBox.vala
src/Widgets/SettingsToggle.vala
src/Widgets/TattleBox.vala
src/Widgets/TextScale.vala
src/Widgets/UserList.vala
src/Widgets/UserRow.vala
9 changes: 9 additions & 0 deletions src/DBus/GeoclueManager.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* SPDX-License-Identifier: GPL-2.0-or-later
* SPDX-FileCopyrightText: 2011-2025 elementary, Inc. (https://elementary.io)
*/

[DBus (name = "org.freedesktop.GeoClue2.Manager")]
interface QuickSettings.GeoclueManager : DBusProxy {
public abstract bool in_use { get; }
}
5 changes: 5 additions & 0 deletions src/PopoverWidget.vala
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public class QuickSettings.PopoverWidget : Gtk.Box {
}

construct {
var tattle_box = new TattleBox () {
halign = CENTER
};

var screen_reader = new SettingsToggle (
_("Screen Reader")
) {
Expand Down Expand Up @@ -75,6 +79,7 @@ public class QuickSettings.PopoverWidget : Gtk.Box {
bottom_box.get_style_context ().add_class ("togglebox");

main_box = new Gtk.Box (VERTICAL, 0);
main_box.add (tattle_box);
main_box.add (toggle_box);
main_box.add (scale_box);
main_box.add (new Gtk.Separator (HORIZONTAL));
Expand Down
50 changes: 50 additions & 0 deletions src/Widgets/TattleBox.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* SPDX-License-Identifier: GPL-2.0-or-later
* SPDX-FileCopyrightText: 2011-2025 elementary, Inc. (https://elementary.io)
*/

public class QuickSettings.TattleBox : Gtk.Bin {
class construct {
set_css_name ("tattlebox");
}

construct {
var location_image = new Gtk.Image.from_icon_name ("location-active-symbolic", MENU);
location_image.get_style_context ().add_class (Granite.STYLE_CLASS_ACCENT);
location_image.get_style_context ().add_class ("purple");

var location_label = new Gtk.Label (_("Location services in use"));

var location_box = new Gtk.Box (HORIZONTAL, 3);
location_box.add (location_image);
location_box.add (location_label);

var location_revealer = new Gtk.Revealer () {
child = location_box
};

child = location_revealer;

setup_geoclue_manager.begin ((obj, res) => {
var geoclue_manager = setup_geoclue_manager.end (res);
if (geoclue_manager == null) {
return;
}

location_revealer.reveal_child = geoclue_manager.in_use;

geoclue_manager.g_properties_changed.connect (() => {
location_revealer.reveal_child = geoclue_manager.in_use;
});
});
}

private async GeoclueManager? setup_geoclue_manager () {
try {
return yield Bus.get_proxy (BusType.SYSTEM, "org.freedesktop.GeoClue2", "/org/freedesktop/GeoClue2/Manager");
} catch (Error e) {
info ("Unable to connect to GeoClue2 bus, location tattle tale will not be available: %s", e.message);
return null;
}
}
}
2 changes: 2 additions & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ sources = [
'Indicator.vala',
'PopoverWidget.vala',
'DBus' / 'EndSessionDialogServer.vala',
'DBus' / 'GeoclueManager.vala',
'DBus' / 'LockInterface.vala',
'DBus' / 'SeatInterface.vala',
'DBus' / 'SensorProxy.vala',
Expand All @@ -25,6 +26,7 @@ sources = [
'Widgets' / 'RotationToggle.vala',
'Widgets' / 'SettingsToggle.vala',
'Widgets' / 'SessionBox.vala',
'Widgets' / 'TattleBox.vala',
'Widgets' / 'TextScale.vala',
'Widgets' / 'UserList.vala',
'Widgets' / 'UserRow.vala',
Expand Down