2020-09-02 02:52:08 +00:00
|
|
|
module MetaBrush.UI.FileBar
|
|
|
|
( FileBar(..), createFileBar, newFileTab
|
|
|
|
, TabLocation(..)
|
|
|
|
)
|
|
|
|
where
|
|
|
|
|
|
|
|
-- gi-gtk
|
|
|
|
import qualified GI.Gtk as GTK
|
|
|
|
|
|
|
|
-- MetaBrush
|
|
|
|
import {-# SOURCE #-} MetaBrush.Context
|
2020-09-02 20:49:50 +00:00
|
|
|
( Variables, UIElements )
|
2020-09-02 02:52:08 +00:00
|
|
|
import MetaBrush.Document
|
|
|
|
( Document )
|
|
|
|
import {-# SOURCE #-} MetaBrush.UI.InfoBar
|
|
|
|
( InfoBar )
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
data FileBar
|
|
|
|
= FileBar
|
|
|
|
{ fileBarBox :: !GTK.Box
|
|
|
|
, fileTabsBox :: !GTK.Box
|
|
|
|
, fileBarPhantomRadioButton :: !GTK.RadioButton
|
|
|
|
}
|
|
|
|
|
|
|
|
data TabLocation
|
|
|
|
= AfterCurrentTab
|
|
|
|
| LastTab
|
|
|
|
|
2020-09-02 20:49:50 +00:00
|
|
|
instance Show TabLocation
|
|
|
|
|
2020-09-02 02:52:08 +00:00
|
|
|
createFileBar
|
|
|
|
:: Variables
|
2020-09-02 20:49:50 +00:00
|
|
|
-> GTK.Window -> GTK.Box -> GTK.Label -> GTK.DrawingArea -> InfoBar
|
2020-09-02 02:52:08 +00:00
|
|
|
-> IO FileBar
|
|
|
|
|
2020-09-02 20:49:50 +00:00
|
|
|
newFileTab :: Variables -> UIElements -> Maybe Document -> TabLocation -> IO ()
|