Commit Graph

17 Commits

Author SHA1 Message Date
Simon Plakolb
5e9bbe5c76 modules: Revert button to label 2022-11-24 13:08:16 +01:00
Alex
bfa3adcfd6
Merge pull request #1120 from pinselimo/use_gtk_button_v2 2022-10-17 09:09:12 +02:00
Ian Manske
cca5227210 Add config value for inhibitor default state. 2022-10-13 21:47:57 -04:00
Simon Plakolb
b8322c4b4b button: Add AButton class
The AButton class is designed as full a substitute to ALabel. The
GtkButton attribute 'button_' is initialized with a label. This
label can the be referenced by the subsequent inheritors of AButton
instead of the GtkLabel attribute 'label_' of ALabel.
For convenience a GtkLabel* 'label_' attribute is added to AButton.

If the button cannot be clicked it is disabled, effectively acting
like its label predecessor.

GtkButton seems to catch one-click mouse events regardless of the
flags set on it. Therefore, 'signal_pressed' is connected to a
function creating a fake GdkEventButton* and calling 'handleToggle'
(for details on this possible bug in GTK see:
https://stackoverflow.com/questions/45334911 )

In accordance with other GtkButtons (i.e. the sway/workspace ones)
set_relief(Gtk::RELIEF_NONE) is called on the 'button_' instance.
2022-10-12 10:25:29 +02:00
Alex
7bbf7c99a3 fix: lint 2022-05-04 17:29:08 +02:00
Louis des Landes
1071b9f7c5 Add a config to set a timeout for the idle_inhibitor module 2022-04-10 22:47:52 +09:30
Alex
f2fcadbf62 refactor: lint 2022-04-06 08:37:19 +02:00
Jordan Leppert
9785a89013 Making active a bool 2020-11-01 18:25:41 +00:00
Jordan Leppert
a9dae931c7 Renaming idle_inhibitor_modules and idle_inhibitor_status to shorter, more convenient names. 2020-11-01 17:14:05 +00:00
Jordan Leppert
071cb86b45 Moving idle inhibitor shared stuff out of Client and into idle_inhibitor module as static members. 2020-11-01 17:09:48 +00:00
Jordan Leppert
bb33427f65 Making idle_inhibitor_ private and initialised in constructor, as it was before. 2020-11-01 13:38:58 +00:00
Jordan Leppert
4889e655eb Since idle_inhibitor's have a surface, we should have one for each inhibitor module. Therefore, the status is stored on the Client, and all modules create or destroy their inhibitors depending on Client's idle_inhibitor_status. Also, when modules are destroyed they remove themselves from Client's idle_inhibitor_modules. 2020-11-01 13:33:28 +00:00
Jordan Leppert
4872091442 Draft fix for syncing idle inhibitor across outputs. The idle_inhibitor surface has been moved to Client, all instances of idle inhibitor module now use one surface between them. Any time an idle inhibitor is clicked, currently it force updates ALL modules on all outputs, this needs work. 2020-10-31 16:31:27 +00:00
Alex
90d89fe974 refactor: kill custom modules scripts en destroy 2019-04-23 15:56:38 +02:00
Alex
6ed8f94dab refactor: format code 2019-04-18 17:52:00 +02:00
Jonas
80ef63791d [bugfix] idle_inhibitor handles click events correctly
- Declare event handler in ALabel virtual so the idle_inhibitor can
  overriding them
- Handle the right click event in idle_inhibitor and call ALabel handler if needed
2019-03-03 22:02:34 +01:00
Jonas
d708ce2be9 Add idle inhibitor module 2019-02-22 16:55:46 +01:00