Class: QTimetrap::TrackerControls::Component
- Inherits:
-
Object
- Object
- QTimetrap::TrackerControls::Component
- Defined in:
- app/components/tracker_controls/component.rb
Overview
Contains main tracking controls, summary labels, and theme actions.
Constant Summary collapse
- TIMER_FONT_MIN_PT =
12- TIMER_FONT_MAX_PT =
20- TIMER_CHAR_WIDTH_FACTOR =
0.72
- TIMER_HORIZONTAL_PADDING =
12- TIMER_FIT_SAMPLE =
'000:00:00'
Instance Attribute Summary collapse
-
#clock_label ⇒ Object
readonly
Returns the value of attribute clock_label.
-
#project_input ⇒ Object
readonly
Returns the value of attribute project_input.
-
#task_input ⇒ Object
readonly
Returns the value of attribute task_input.
-
#timer_label ⇒ Object
readonly
Returns the value of attribute timer_label.
-
#widget ⇒ Object
readonly
Returns the value of attribute widget.
Instance Method Summary collapse
-
#initialize(parent:, callbacks:) ⇒ Component
constructor
A new instance of Component.
- #update_action_button(running:) ⇒ Object
- #update_project_input(project_name) ⇒ Object
- #update_summary(text) ⇒ Object
- #update_task_input(text) ⇒ Object
- #update_theme_label(theme_name) ⇒ Object
Constructor Details
#initialize(parent:, callbacks:) ⇒ Component
Returns a new instance of Component.
15 16 17 |
# File 'app/components/tracker_controls/component.rb', line 15 def initialize(parent:, callbacks:) assign_ui(build_ui(parent:, callbacks:)) end |
Instance Attribute Details
#clock_label ⇒ Object (readonly)
Returns the value of attribute clock_label.
13 14 15 |
# File 'app/components/tracker_controls/component.rb', line 13 def clock_label @clock_label end |
#project_input ⇒ Object (readonly)
Returns the value of attribute project_input.
13 14 15 |
# File 'app/components/tracker_controls/component.rb', line 13 def project_input @project_input end |
#task_input ⇒ Object (readonly)
Returns the value of attribute task_input.
13 14 15 |
# File 'app/components/tracker_controls/component.rb', line 13 def task_input @task_input end |
#timer_label ⇒ Object (readonly)
Returns the value of attribute timer_label.
13 14 15 |
# File 'app/components/tracker_controls/component.rb', line 13 def timer_label @timer_label end |
#widget ⇒ Object (readonly)
Returns the value of attribute widget.
13 14 15 |
# File 'app/components/tracker_controls/component.rb', line 13 def end |
Instance Method Details
#update_action_button(running:) ⇒ Object
36 37 38 39 40 41 |
# File 'app/components/tracker_controls/component.rb', line 36 def (running:) .visible = !running .visible = running task_input.read_only = running project_input.read_only = running end |
#update_project_input(project_name) ⇒ Object
23 24 25 26 |
# File 'app/components/tracker_controls/component.rb', line 23 def update_project_input(project_name) value = project_name.to_s.strip project_input.text = value end |
#update_summary(text) ⇒ Object
19 20 21 |
# File 'app/components/tracker_controls/component.rb', line 19 def update_summary(text) summary_label.text = text end |
#update_task_input(text) ⇒ Object
28 29 30 |
# File 'app/components/tracker_controls/component.rb', line 28 def update_task_input(text) task_input.text = text.to_s end |
#update_theme_label(theme_name) ⇒ Object
32 33 34 |
# File 'app/components/tracker_controls/component.rb', line 32 def update_theme_label(theme_name) .text = "THEME: #{theme_name.upcase}" end |