Skip to content
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 option to hide the daily activity summary #373

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
<description>Sets the panel appearance. 0 - label, 1 - icon, 2 - label and icon.</description>
</key>

<key name="show-summary" type="b">
<default>true</default>
<summary>Display categories summary.</summary>
<description>Whether to display a summary of today's categories.</description>
</key>

<key type="as" name="show-hamster-dropdown">
<default><![CDATA[['<Super>t']]]></default>
<summary>Global key combination to show the drop-down.</summary>
Expand Down
12 changes: 9 additions & 3 deletions extension/widgets/factsBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ class FactsBox extends PopupMenu.PopupBaseMenuItem {
this._scrollAdjustment = this.todaysFactsWidget.vscroll.adjustment;
main_box.add_child(this.todaysFactsWidget);

this._settings = controller.settings;

// Setup category summery
this.summaryLabel = new CategoryTotalsWidget();
main_box.add_child(this.summaryLabel);
if (this._settings.get_boolean("show-summary")) {
this.summaryLabel = new CategoryTotalsWidget();
main_box.add_child(this.summaryLabel);
}
// Setup total time
this.totalTimeLabel = new TotalTimeWidget();
main_box.add_child(this.totalTimeLabel);
Expand All @@ -86,7 +90,9 @@ class FactsBox extends PopupMenu.PopupBaseMenuItem {
refresh(facts, ongoingFact) {
this.todaysFactsWidget.refresh(facts, ongoingFact);
this.totalTimeLabel.refresh(facts);
this.summaryLabel.refresh(facts);
if (this._settings.get_boolean("show-summary")) {
this.summaryLabel.refresh(facts);
}

}

Expand Down