Commit Graph

110 Commits

Author SHA1 Message Date
Sergey Mishin 110c66dd32
Refactor Clock: generalize multi timezones and single timezone cases
After this refactoring:
1. Timezones parses only once on start and the we refer to saved values. All time_zone.isString() checks gone to the constructor.
2. Single timezone case handling as case of multi timezoned logic.
3. Scroll event seems more clear now.
4. Tooltip template parses on start to check if there calendar placeholder or not. To do not calculate calendar_text() if not necessary.
2021-10-03 16:57:55 +00:00
Sergey Mishin 174db444d6
Fix Clock crash on empty string in timezones field
Also fixed timezones behavior: now waybar starting with the first timezone in timezones list and falling back to timezone field only if timezones omit or has no elements.
2021-10-03 03:27:54 +00:00
Elyes HAOUAS f18eb71ad7 Fix spelling errors
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
2021-10-02 18:13:17 +02:00
John Helmert III 368e4813de
libfmt >=8.0.0 compatibility 2021-06-30 13:12:38 -05:00
nullobsi ecba117dc0
remove unnessecary logging 2021-01-31 11:56:25 -08:00
nullobsi d2a1f41750
Use g_unichar_iswide to properly align calendar on CJK locales 2021-01-31 11:53:53 -08:00
Thomas Hebb 29f78e0426 Fix a few compiler warnings
There was one uninitialized value warning and two mismatched-sign
compare warnings. They both appear valid, the first occurring when MPD's
"format-stopped" contains {songPosition} or {queueLength} and the second
occurring when the clock's "timezones" array is more than 2 billion
items long (not likely, I admit). Fix both issues.
2020-11-30 18:07:22 -08:00
Daniel De Graaf 62082bdb01 clock: scroll through multiple timezones 2020-08-13 18:53:18 -04:00
Daniel De Graaf 8cd6e13308 clock: allow custom formatting for today in calendar 2020-08-13 18:53:18 -04:00
Alex b251c51936 fix: spdlog 2020-05-22 20:02:09 +02:00
Alex 60bad8279e feat: add comment 2020-05-22 19:09:50 +02:00
Alex a871dcaebe fix: type 2020-05-22 18:56:32 +02:00
Alex cef5b27b48 fix: prefer default fmt date formatting unless timezone specified 2020-05-22 18:52:26 +02:00
Alex 4a7dd400fe
Merge branch 'master' into on-update 2020-04-12 18:32:19 +02:00
Alex b40cdcb5bd refactor: call parent update 2020-04-12 18:30:21 +02:00
Aleksei Bavshin e70f8d8730
fix(clock): lower precision of zoned_time to avoid fractional seconds in output 2020-02-06 10:04:22 -08:00
Skirmantas Kligys d1f427618f Cache calendar per clock instance, weekdays properly handle locales. 2020-02-05 11:07:47 -08:00
Skirmantas Kligys cd2db19267 Detect presence, call nl_langinfo() to get first day of week. 2020-02-03 17:18:34 -08:00
Skirmantas Kligys 4c40f9c635 Stop using a mutex for guarding CachedCalendar. 2020-02-03 17:18:34 -08:00
Skirmantas Kligys 218bb3bc2b Simpify calendar generation, single loop handles both first week and subsequent weeks. 2020-02-02 16:06:27 -08:00
Skirmantas Kligys f6b2005687 Cache calendar tooltip text to reduce computations. 2020-02-02 15:59:24 -08:00
Skirmantas Kligys ea9591baea Switch from utfcpp to Glib::ustring for UTF-8 string mangling. 2020-02-02 15:59:24 -08:00
Skirmantas Kligys 8e05aab4d9 Current month calendar in clock tooltip. 2020-01-31 10:36:40 -08:00
Guillaume Maudoux 84b671f6b2 Attempt at supporting locale and timezones (#1) 2020-01-23 08:27:10 -05:00
Michael Cordover 6e30b7af3c Remove duplicate dependency, use current locale 2020-01-23 08:27:00 -05:00
Michael Cordover 3130a57622 Add timezone support to clock module (closes #223) 2020-01-23 08:26:49 -05:00
Jordi Pakey-Rodriguez 0f0765e517 feat(modules): call user on-update if configured 2019-12-05 14:42:36 -08:00
Guillaume Maudoux 1e82982dbd
Detect timezone changes
Fixes #479, because upstream does not intend to.

It may be less expensive to do that only once in a while, or to inotify-watch on /etc/timezone, but this is good enough.
2019-10-04 23:25:09 +02:00
Alex d24d85bebf refactor: move label name and id to label contructor 2019-05-22 12:06:24 +02:00
Alex 97bd637f5d refactor(clock): avoid usless time_point_cast 2019-05-22 11:51:33 +02:00
Alex 23d4a811db refactor(clock): avoid usless duration_cast 2019-05-22 11:48:02 +02:00
Alex 5314b74dae fix: remove workaround 2019-05-20 14:39:49 +02:00
RX14 5e43b4f587
Fix clock is always a second off 2019-05-19 13:30:19 +01:00
Alex 311c34ecbc feat(Bar): handle widget size changes 2019-04-24 12:37:24 +02:00
Alex 6ed8f94dab refactor: format code 2019-04-18 17:52:00 +02:00
Alex ef88f0a223 fix: clock rounding 2019-03-07 12:34:21 +01:00
Piet van der Loo 7245fb5d0a Added clock tooltip with optional alternate format 2019-02-24 09:25:34 +01:00
Alexis 399f61df98 refactor: proper modules destruction 2019-01-13 22:22:22 +01:00
Alexis b554094c7e feat: args && class id 2018-12-18 17:30:54 +01:00
Alexis 7befd27059 fix: clock interval 2018-12-04 09:38:08 +01:00
Alexis 2b05b8e69a chore: v0.2.2 2018-11-23 12:03:23 +01:00
Alexis ad7400d5ce refactor(ALabel): add interval 2018-11-23 11:57:37 +01:00
Alexis bd62c4cbc5 feat(Label): use set_markup 2018-11-21 20:49:09 +01:00
Alexis 3f269ff463 fix: check json::value type 2018-10-26 09:27:16 +02:00
dangerousdan 137c5fb712
fix custom intervals causing cpu to go mental 2018-10-23 00:06:46 +01:00
Alexis 53956d9d18
feat(ALabel): Toggleable labels 2018-08-27 01:36:25 +02:00
Alex 49232eed8d
Clean (#31) 2018-08-20 14:50:45 +02:00
Alexis 8ce33e0c64 fix(window): pick only con title 2018-08-19 20:37:33 +02:00
Alex 6705134034
Handle screens disconnection (#29) 2018-08-19 13:39:57 +02:00
Alexis b1fd4d7b82 feat(modules): generic label module to allow max-length on all labels 2018-08-18 11:43:48 +02:00
Alex 6635548d3e
Style code (#25) 2018-08-16 14:29:41 +02:00
Alexis 008856cbb8 feat(clock): allow choose interval 2018-08-15 21:00:04 +02:00
Alexis 608b791ac1 refactor(clock): use fmt::localtime 2018-08-15 20:53:27 +02:00
Alexis e3e099f836 feat(workspaces): icons 2018-08-15 14:48:08 +02:00
Alexis 04183dc696 refactor(modules): prefer sigc::mem_fun 2018-08-11 02:40:13 +02:00
Alexis 2512d51564 fix(gtk): use idle to avoid mutex 2018-08-10 23:21:21 +02:00
Alexis dc4e4860bd feat(config): format modules 2018-08-09 13:30:11 +02:00
Alexis 39a0ae04a8 feat: basic config file 2018-08-09 12:05:48 +02:00
Alexis b987668f97 style: clean class 2018-08-09 10:50:16 +02:00
Alexis fcb6a9aa8b feat: init repo 2018-08-08 23:54:58 +02:00