-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cutomizable timer duration #319
base: master
Are you sure you want to change the base?
Conversation
It look like there is some issues with my code, I can't fix PR right now, I will have more time tomorrow evening. Cheers |
I haven't looked at the code yet, but would it be better to store timer lengths using 1 key as an array, instead of 3 separate keys? Also, if I remember correctly, red is supposed to be for destructive actions according to the GNOME Human Interface Guidelines I think it was? I don't know if that applies to extensions, but it might be worth considering to be consistent with the rest of GNOME. Still, this is a clear improvement over the current system, nice work :) |
Yes I totally agree, I was thinking the same. I just used a simple 'int' type for each duration but it need to be unified with a single key.
It make sense, I hesitated to keep the red color anyway so I can remove it. There are some other small improvements to make, I'll try to fix it all this evening or tomorrow for final review. |
There is a weird eslint issue:
The code is the same as line 66, but it cause an error only in line 283. Should I ignore this using |
I think it's because the variables have different names, |
Thanks |
let enableCustomTimerSwitch = new Gtk.Switch({ | ||
valign: Gtk.Align.CENTER, | ||
active: this._settings.get_boolean(this._settingsKey.USE_CUSTOM_DURATION) | ||
}); | ||
this.enableCustomTimerRow = new Adw.ActionRow({ | ||
title: _('Enable custom values'), | ||
subtitle: _('Select custom value for each duration'), | ||
activatable_widget: enableCustomTimerSwitch | ||
}); | ||
this.enableCustomTimerRow.add_suffix(enableCustomTimerSwitch); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let enableCustomTimerSwitch = new Gtk.Switch({ | |
valign: Gtk.Align.CENTER, | |
active: this._settings.get_boolean(this._settingsKey.USE_CUSTOM_DURATION) | |
}); | |
this.enableCustomTimerRow = new Adw.ActionRow({ | |
title: _('Enable custom values'), | |
subtitle: _('Select custom value for each duration'), | |
activatable_widget: enableCustomTimerSwitch | |
}); | |
this.enableCustomTimerRow.add_suffix(enableCustomTimerSwitch); | |
this.enableCustomTimerRow = new Adw.SwitchRow({ | |
title: _('Enable custom values'), | |
subtitle: _('Select custom value for each duration'), | |
active: this._settings.get_boolean(this._settingsKey.USE_CUSTOM_DURATION) | |
}); |
SwitchRow was introduced with libadwaita 1.4 (Gnome 45). It would make sense to use it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I changed it.
|
||
// Bind signals | ||
// -------------- | ||
enableCustomTimerSwitch.connect('notify::active', (widget) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enableCustomTimerSwitch.connect('notify::active', (widget) => { | |
this.enableCustomTimerRow.connect('notify::active', (widget) => { |
See above
31cf5cd
to
79915b7
Compare
Thanks for reporting, icon fixed. Tested in Ubuntu 24.04 / Fedora 40. |
The pipeline failure seems to be eslint 9 complaining about arguments, we wouldn't need to try and fix it if we just drop the jsdoc stuff, since I don't think we don't really use it anyway If we drop it we just need to update the makefile, workflow definition and linter configs |
I tried to remove the jsdoc plugin but it's seams that we need to rewrite the entire Eslint config for version 9.0 (migrate-to-9.0.0) as they changed the config file format. Should we make a separate PR for this ? |
Yeah, probably a good idea |
This feature is awesome. I've been wanting long timers since I work on dual computers and need both on during my work day. This is saving me from having to remember to turn caffeine off at the end of my work day. |
7ef6741
to
dd1222c
Compare
@eonpatapon @stuarthayhurst |
Looks ok to me, do we want to merge this with a squash merge since there are a lot of small commits and fixes for previous commits? |
Remove old code
Clean durations title Clean code
Fix translations
Fix spaces and syntax issues Remove unused vars
Fix spacing Remove trailling space Fix object-shorthand Fix spacing
Fix object-shorthand with value Rename constant with uppercase Symplify code Replace Gtk.Switch/ActionRow with Adw.SwitchRow Improve code: get durations values Fix stopwatch icon Update translations
This reverts commit 89ec49c.
Update locales Update catalan translation
this.sliderTimer.add_mark(0, Gtk.PositionType.BOTTOM, null); | ||
this.sliderTimer.add_mark(1, Gtk.PositionType.BOTTOM, null); | ||
this.sliderTimer.add_mark(2, Gtk.PositionType.BOTTOM, null); | ||
this.sliderTimer.add_mark(3, Gtk.PositionType.BOTTOM, null); | ||
this.sliderTimer.add_mark(4, Gtk.PositionType.BOTTOM, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a loop instead?
Add new "Timer" menu in preferences with customizable timer duration.
This will close #296