[gnome-sound-recorder/bilelmoussaoui/better-shortcuts: 2/3] recorder: animate duration when paused
- From: Bilal Elmoussaoui <bilelmoussaoui src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sound-recorder/bilelmoussaoui/better-shortcuts: 2/3] recorder: animate duration when paused
- Date: Wed, 9 Sep 2020 18:16:08 +0000 (UTC)
commit 4dcdfcce295f858ceacb03b49bc77e8dc297bc27
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date: Wed Sep 9 17:16:32 2020 +0200
recorder: animate duration when paused
borrowed from clocks
data/application.css | 15 ++++++++++++++-
src/recorderWidget.js | 2 ++
2 files changed, 16 insertions(+), 1 deletion(-)
---
diff --git a/data/application.css b/data/application.css
index 87b7fe8..172c129 100644
--- a/data/application.css
+++ b/data/application.css
@@ -3,7 +3,20 @@
font-weight: 300
}
-button.rounded-button {
+@keyframes clocks-blink {
+ 0% { color: @theme_text_color; }
+ 100% { color: #FF0000; }
+}
+
+.recorder-time-label.paused {
+ color: #FF0000;
+ animation-name: clocks-blink;
+ animation-iteration-count: infinite;
+ animation-timing-function: cubic-bezier(1.0,0,0,1.0);
+ animation-duration: 1s;
+}
+
+button.rounded-button {
padding: 4px;
border-radius: 9999px;
-gtk-outline-radius: 9999px;
diff --git a/src/recorderWidget.js b/src/recorderWidget.js
index 4335130..8b01278 100644
--- a/src/recorderWidget.js
+++ b/src/recorderWidget.js
@@ -142,6 +142,7 @@ var RecorderWidget = GObject.registerClass({
this.actionsGroup.lookup('pause').enabled = false;
this.actionsGroup.lookup('resume').enabled = true;
this._resumeBtn.grab_focus();
+ this._recorderTime.get_style_context().add_class('paused');
break;
case RecorderState.RECORDING:
this.actionsGroup.lookup('start').enabled = false;
@@ -149,6 +150,7 @@ var RecorderWidget = GObject.registerClass({
this.actionsGroup.lookup('resume').enabled = false;
this.actionsGroup.lookup('pause').enabled = true;
this._pauseBtn.grab_focus();
+ this._recorderTime.get_style_context().remove_class('paused');
break;
case RecorderState.STOPPED:
this.actionsGroup.lookup('start').enabled = true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]