GTK: make tabs reorderable and scrollable

This commit is contained in:
Julian Ospald 2016-05-10 02:16:03 +02:00
parent 8739ccc55f
commit 274aabe1f3
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
2 changed files with 10 additions and 1 deletions

View File

@ -364,6 +364,7 @@
<object class="GtkNotebook" id="notebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="scrollable">True</property>
<child>
<placeholder/>
</child>

View File

@ -37,6 +37,10 @@ import Control.Exception
try
, SomeException
)
import Control.Monad
(
forM_
)
import qualified Data.ByteString as BS
import Data.Foldable
(
@ -89,8 +93,12 @@ import System.Posix.FilePath
newTab :: MyGUI -> IO FMView -> Path Abs -> IO MyView
newTab mygui iofmv path = do
myview <- createMyView mygui iofmv
_ <- notebookAppendPage (notebook mygui) (viewBox myview)
i <- notebookAppendPage (notebook mygui) (viewBox myview)
(maybe (P.fromAbs path) P.fromRel $ P.basename path)
mpage <- notebookGetNthPage (notebook mygui) i
forM_ mpage $ \page -> notebookSetTabReorderable (notebook mygui)
page
True
refreshView mygui myview (Just path)
return myview