GTK: add "New -> Terminal" to right-click menu

This commit is contained in:
Julian Ospald 2016-06-03 14:42:28 +02:00
parent 077ac81227
commit 3e4621fe70
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
4 changed files with 20 additions and 1 deletions

View File

@ -518,13 +518,22 @@
</child>
<child>
<object class="GtkImageMenuItem" id="rcFileNewTab">
<property name="label" translatable="yes">New Tab</property>
<property name="label" translatable="yes">Tab</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="image">image8</property>
<property name="use_stock">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem" id="rcFileNewTerm">
<property name="label" translatable="yes">Terminal</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="image">image9</property>
<property name="use_stock">False</property>
</object>
</child>
</object>
</child>
</object>
@ -634,6 +643,11 @@
<property name="can_focus">False</property>
<property name="stock">gtk-add</property>
</object>
<object class="GtkImage" id="image9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">utilities-terminal</property>
</object>
<object class="GtkBox" id="viewBox">
<property name="visible">True</property>
<property name="can_focus">False</property>

View File

@ -296,6 +296,8 @@ setViewCallbacks mygui myview = do
liftIO $ newDir mygui myview
_ <- (rcFileNewTab . rcmenu) myview `on` menuItemActivated $
liftIO $ newTab' mygui myview
_ <- (rcFileNewTerm . rcmenu) myview `on` menuItemActivated $
liftIO $ void $ openTerminalHere myview
_ <- (rcFileCopy . rcmenu) myview `on` menuItemActivated $
liftIO $ withItems mygui myview copyInit
_ <- (rcFileRename . rcmenu) myview `on` menuItemActivated $

View File

@ -108,6 +108,7 @@ data RightClickMenu = MkRightClickMenu {
, rcFileNewRegFile :: !ImageMenuItem
, rcFileNewDir :: !ImageMenuItem
, rcFileNewTab :: !ImageMenuItem
, rcFileNewTerm :: !ImageMenuItem
, rcFileCut :: !ImageMenuItem
, rcFileCopy :: !ImageMenuItem
, rcFileRename :: !ImageMenuItem

View File

@ -163,6 +163,8 @@ createMyView mygui iofmv = do
"rcFileNewDir"
rcFileNewTab <- builderGetObject builder castToImageMenuItem
"rcFileNewTab"
rcFileNewTerm <- builderGetObject builder castToImageMenuItem
"rcFileNewTerm"
rcFileCut <- builderGetObject builder castToImageMenuItem
"rcFileCut"
rcFileCopy <- builderGetObject builder castToImageMenuItem