Skip to content

Commit

Permalink
Fix #52
Browse files Browse the repository at this point in the history
  • Loading branch information
gnunn1 committed Jan 24, 2016
1 parent f20e4dc commit c2dea6e
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 3 deletions.
14 changes: 14 additions & 0 deletions data/gsettings/com.gexperts.Terminix.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -587,5 +587,19 @@
<default>'&lt;Ctrl&gt;&lt;Shift&gt;a'</default>
<summary>Keyboard shortcut to select all text in terminal</summary>
</key>
<key name="terminal-zoom-in" type="s">
<default>'&lt;Ctrl&gt;plus'</default>
<summary>Keyboard shortcut to make font larger</summary>
</key>
<key name="terminal-zoom-out" type="s">
<default>'&lt;Ctrl&gt;minus'</default>
<summary>Keyboard shortcut to make font smaller</summary>
</key>
<key name="terminal-zoom-normal" type="s">
<default>'&lt;Ctrl&gt;0'</default>
<summary>Keyboard shortcut to make font normal-size</summary>
</key>


</schema>
</schemalist>
11 changes: 10 additions & 1 deletion po/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ msgid "Could not locate session for dropped terminal"
msgstr "Could not locate session for dropped terminal"

msgid "Could not load session due to unexpected error."
msg str "Could not load session due to unexpected error."
msgstr "Could not load session due to unexpected error."

msgid "Load Session"
msgstr "Load Session"
Expand Down Expand Up @@ -648,3 +648,12 @@ msgstr "Switch To Next Terminal"

msgid "title"
msgstr "Title"

msgid "zoom-in"
msgstr "Zoom In"

msgid "zoom-out"
msgstr "Zoom Out"

msgid "zoom-normal"
msgstr "Zoom Normal"
11 changes: 10 additions & 1 deletion po/terminix.pot
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ msgid "Could not locate session for dropped terminal"
msgstr "Could not locate session for dropped terminal"

msgid "Could not load session due to unexpected error."
msg str "Could not load session due to unexpected error."
msgstr "Could not load session due to unexpected error."

msgid "Load Session"
msgstr "Load Session"
Expand Down Expand Up @@ -647,3 +647,12 @@ msgstr "switch-to-next-terminal"

msgid "title"
msgstr "title"

msgid "zoom-in"
msgstr "zoom-in"

msgid "zoom-out"
msgstr "zoom-out"

msgid "zoom-normal"
msgstr "zoom-normal"
5 changes: 4 additions & 1 deletion source/gx/terminix/terminal/actions.d
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ enum ACTION_PROFILE_PREFERENCE = "profile-preference";
enum ACTION_READ_ONLY = "read-only";
enum ACTION_COPY = "copy";
enum ACTION_PASTE = "paste";
enum ACTION_SELECT_ALL = "select-all";
enum ACTION_SELECT_ALL = "select-all";
enum ACTION_ZOOM_IN = "zoom-in";
enum ACTION_ZOOM_OUT = "zoom-out";
enum ACTION_ZOOM_NORMAL = "zoom-normal";
18 changes: 18 additions & 0 deletions source/gx/terminix/terminal/terminal.d
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,24 @@ private:
}
});
registerActionWithSettings(group, ACTION_PREFIX, ACTION_SELECT_ALL, gsShortcuts, delegate(GVariant, SimpleAction) { vte.selectAll(); });

//Zoom actions
registerActionWithSettings(group, ACTION_PREFIX, ACTION_ZOOM_IN, gsShortcuts, delegate(GVariant, SimpleAction) {
if (vte.getFontScale()<5) {
trace("Zoom In");
vte.setFontScale(vte.getFontScale() + 0.1);
}
});
registerActionWithSettings(group, ACTION_PREFIX, ACTION_ZOOM_OUT, gsShortcuts, delegate(GVariant, SimpleAction) {
if (vte.getFontScale()>0.1) {
trace("Zoom Out");
vte.setFontScale(vte.getFontScale() - 0.1);
}
});
registerActionWithSettings(group, ACTION_PREFIX, ACTION_ZOOM_NORMAL, gsShortcuts, delegate(GVariant, SimpleAction) {
trace("Zoom Normal");
vte.setFontScale(1.0);
});

//Override terminal title
registerActionWithSettings(group, ACTION_PREFIX, ACTION_TITLE, gsShortcuts, delegate(GVariant, SimpleAction) {
Expand Down

0 comments on commit c2dea6e

Please sign in to comment.