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"> <object class="GtkNotebook" id="notebook">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="scrollable">True</property>
<child> <child>
<placeholder/> <placeholder/>
</child> </child>

View File

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