Commit Graph

38 Commits

Author SHA1 Message Date
Aleksei Bavshin ea17a66dfc
fix: compilation errors with cpp_std=c++20
There were two main issues with fmtlib and C++20 mode:

 - `fmt::format` defaults to compile-time argument checking and requires
   using `fmt::runtime(format_string)` to bypass that.
 - `std::format` implementation introduces conflicting declarations and
   we have to specify the namespace for all `format`/`format_to` calls.
2023-01-20 22:50:02 -08:00
Simon Plakolb 5e9bbe5c76 modules: Revert button to label 2022-11-24 13:08:16 +01:00
Alex 8551c4bbe3 fix: lint 2022-10-17 09:19:00 +02: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 2b735f44bc modules: Set tooltip on button
Mouse-over tooltips set on the label only appear once the mouse hovers
over exactly the label. Other apps (e.g. firefox) show the tooltip once
the pointer hovers the button. Not solely its label. With this commit we
get the same behaviour.
2022-10-12 10:25:30 +02:00
Simon Plakolb 8fa5d9b838 modules: Set style-context on button
Fixes issue where the class parameters in style.css would have no
effect.

The CSS now references the GtkButton instead of the GtkLabel. Removing
all style-classes from the custom module GtkButton however removes
any properties set via style.css. Thus, the default classes 'flat' and
'text-button' are added on every update of these modules.
2022-10-12 10:25:30 +02: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
asas1asas200 55e83f90d1 feat(idle-inhibitor): add tooltip format 2022-09-03 19:21:32 +08: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
Andy Russell 95a6689077
disable Idle Inhibitor module if unsupported 2021-02-09 18:37:13 -05:00
Alex faacd76f62
Merge pull request #892 from alebastr/layer-surfaces-v3
Refactor layer surface implementations (again)
2020-11-02 10:17:57 +01:00
Jordan Leppert 9785a89013 Making active a bool 2020-11-01 18:25:41 +00:00
Jordan Leppert b015836e7b Ensure style class is removed from all IdleInhibitor instances by moving it to update(). 2020-11-01 18:17:51 +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 c6743988d3 Removing 'click_param' as it is no longer used. 2020-11-01 16:03:39 +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 aa4fc3dd29 Idle inhibitor toggle no longer update all modules - a list of idle inhibitors is maintained on the Client. 2020-10-31 17:30:25 +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
Aleksei Bavshin f97de599dd
refactor: header cleanup
Replace a couple of header includes with forward declarations.
2020-10-28 08:08:03 -07:00
Alex b40cdcb5bd refactor: call parent update 2020-04-12 18:30:21 +02:00
Jordi Pakey-Rodriguez 0f0765e517 feat(modules): call user on-update if configured 2019-12-05 14:42:36 -08:00
Alex d24d85bebf refactor: move label name and id to label contructor 2019-05-22 12:06:24 +02:00
Alex 1a024db03c fix(idle_inhibitor): overload 2019-05-02 17:51:01 +02:00
Alex 5623bbecfe feat(idle_inhibitor): pass status to click events exec 2019-05-02 16:56:45 +02:00
Alex 1e871b2353 refactor: propagate the event further 2019-05-02 16:46:53 +02:00
Alex 311c34ecbc feat(Bar): handle widget size changes 2019-04-24 12:37:24 +02: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
Alex 807ef32357 refactor: format && better output management 2019-04-18 17:47:40 +02:00
Alex 973cec1713 feat(idle): add status class 2019-03-10 10:29:06 +01: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 c2ed0cb832 Add the possibility to disable the tooltip 2019-02-22 16:58:36 +01:00
Jonas d708ce2be9 Add idle inhibitor module 2019-02-22 16:55:46 +01:00