Merge lp:~artem-anufrij/scratch/Bugfix-1395412 into lp:~elementary-apps/scratch/scratch

Proposed by Artem Anufrij
Status: Merged
Approved by: Danielle Foré
Approved revision: 1416
Merged at revision: 1416
Proposed branch: lp:~artem-anufrij/scratch/Bugfix-1395412
Merge into: lp:~elementary-apps/scratch/scratch
Diff against target: 38 lines (+5/-2)
1 file modified
src/MainWindow.vala (+5/-2)
To merge this branch: bzr merge lp:~artem-anufrij/scratch/Bugfix-1395412
Reviewer Review Type Date Requested Status
Gero.Bare (community) Approve
elementary Apps team Pending
Review via email: mp+242588@code.launchpad.net

Commit message

hide zoom button if welcome screen is visible.

Description of the change

hide zoom button if welcome screen is visible.

To post a comment you must log in.
Revision history for this message
Gero.Bare (gero-bare) wrote :

Nice work.
This performs as expected.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/MainWindow.vala'
--- src/MainWindow.vala 2014-11-10 18:09:21 +0000
+++ src/MainWindow.vala 2014-11-23 10:55:52 +0000
@@ -203,7 +203,6 @@
203 // Set actions sensitive property203 // Set actions sensitive property
204 main_actions.get_action ("SaveFile").visible = (!settings.autosave || doc.file == null);204 main_actions.get_action ("SaveFile").visible = (!settings.autosave || doc.file == null);
205 main_actions.get_action ("SaveFileAs").visible = (doc.file != null);205 main_actions.get_action ("SaveFileAs").visible = (doc.file != null);
206 main_actions.get_action ("Zoom").visible = get_current_font_size () != get_default_font_size ();
207 doc.check_undoable_actions ();206 doc.check_undoable_actions ();
208 });207 });
209208
@@ -317,6 +316,9 @@
317 main_actions.get_action ("Revert").sensitive = val;316 main_actions.get_action ("Revert").sensitive = val;
318 this.toolbar.share_app_menu.sensitive = val;317 this.toolbar.share_app_menu.sensitive = val;
319318
319 // Zoom button
320 main_actions.get_action ("Zoom").visible = get_current_font_size () != get_default_font_size () && val;
321
320 // PlugIns322 // PlugIns
321 if (val) {323 if (val) {
322 on_plugin_toggled (this.contextbar);324 on_plugin_toggled (this.contextbar);
@@ -559,7 +561,6 @@
559 font_size = (int) get_default_font_size ();561 font_size = (int) get_default_font_size ();
560 }562 }
561563
562
563 if (direction == ScrollDirection.DOWN) {564 if (direction == ScrollDirection.DOWN) {
564 font_size --;565 font_size --;
565 if (font_size < FONT_SIZE_MIN)566 if (font_size < FONT_SIZE_MIN)
@@ -572,6 +573,8 @@
572573
573 string new_font = font + " " + font_size.to_string ();574 string new_font = font + " " + font_size.to_string ();
574 Scratch.settings.font = new_font;575 Scratch.settings.font = new_font;
576
577 main_actions.get_action ("Zoom").visible = get_current_font_size () != get_default_font_size () && !split_view.is_empty ();
575 }578 }
576579
577 public string get_current_font () {580 public string get_current_font () {

Subscribers

People subscribed via source and target branches