mirror of
https://gitlab.com/sheaf/metabrush.git
synced 2024-11-23 15:34:06 +00:00
add panels
This commit is contained in:
parent
62ea168667
commit
8e051c0f14
64
app/Main.hs
64
app/Main.hs
|
@ -114,11 +114,11 @@ main = do
|
|||
uiGrid <- GTK.gridNew
|
||||
GTK.setContainerChild baseOverlay uiGrid
|
||||
|
||||
logo <- GTK.boxNew GTK.OrientationVertical 0
|
||||
titleBar <- GTK.boxNew GTK.OrientationHorizontal 0
|
||||
toolBar <- GTK.boxNew GTK.OrientationVertical 0
|
||||
mainPane <- GTK.panedNew GTK.OrientationHorizontal
|
||||
panelGrid <- GTK.gridNew
|
||||
logo <- GTK.boxNew GTK.OrientationVertical 0
|
||||
titleBar <- GTK.boxNew GTK.OrientationHorizontal 0
|
||||
toolBar <- GTK.boxNew GTK.OrientationVertical 0
|
||||
mainPane <- GTK.panedNew GTK.OrientationHorizontal
|
||||
panelBox <- GTK.boxNew GTK.OrientationVertical 0
|
||||
|
||||
GTK.gridAttach uiGrid logo 0 0 1 2
|
||||
GTK.gridAttach uiGrid titleBar 1 0 2 1
|
||||
|
@ -127,8 +127,8 @@ main = do
|
|||
|
||||
mainView <- GTK.boxNew GTK.OrientationVertical 0
|
||||
|
||||
GTK.panedPack1 mainPane mainView True False
|
||||
GTK.panedPack2 mainPane panelGrid False False
|
||||
GTK.panedPack1 mainPane mainView True False
|
||||
GTK.panedPack2 mainPane panelBox False False
|
||||
|
||||
fileBar <- GTK.scrolledWindowNew ( Nothing @GTK.Adjustment ) ( Nothing @GTK.Adjustment )
|
||||
viewportGrid <- GTK.gridNew
|
||||
|
@ -420,7 +420,55 @@ main = do
|
|||
---------------------------------------------------------
|
||||
-- Panels
|
||||
|
||||
widgetAddClass panelGrid "panels"
|
||||
widgetAddClass panelBox "panels"
|
||||
|
||||
pane1 <- GTK.panedNew GTK.OrientationVertical
|
||||
GTK.boxPackStart panelBox pane1 True True 0
|
||||
|
||||
panels1 <- GTK.notebookNew
|
||||
panels2 <- GTK.notebookNew
|
||||
|
||||
GTK.notebookSetGroupName panels1 ( Just "Panel" )
|
||||
GTK.notebookSetGroupName panels2 ( Just "Panel" )
|
||||
|
||||
GTK.panedPack1 pane1 panels1 True True
|
||||
GTK.panedPack2 pane1 panels2 True True
|
||||
|
||||
strokesPanel <- GTK.boxNew GTK.OrientationVertical 0
|
||||
brushesPanel <- GTK.boxNew GTK.OrientationVertical 0
|
||||
transformPanel <- GTK.boxNew GTK.OrientationVertical 0
|
||||
|
||||
strokesTab <- GTK.labelNew ( Just "Strokes" )
|
||||
brushesTab <- GTK.labelNew ( Just "Brushes" )
|
||||
transformTab <- GTK.labelNew ( Just "Transform" )
|
||||
|
||||
for_ [ strokesTab, brushesTab, transformTab ] \ tab -> do
|
||||
widgetAddClasses tab [ "plain", "text", "panelTab" ]
|
||||
|
||||
for_ [ strokesPanel, brushesPanel, transformPanel ] \ panel -> do
|
||||
widgetAddClass panel "panel"
|
||||
|
||||
void $ GTK.notebookAppendPage panels1 strokesPanel ( Just strokesTab )
|
||||
void $ GTK.notebookAppendPage panels1 brushesPanel ( Just brushesTab )
|
||||
|
||||
void $ GTK.notebookAppendPage panels2 transformPanel ( Just transformTab )
|
||||
|
||||
GTK.notebookSetTabReorderable panels1 strokesPanel True
|
||||
GTK.notebookSetTabDetachable panels1 strokesPanel True
|
||||
GTK.notebookSetTabReorderable panels1 brushesPanel True
|
||||
GTK.notebookSetTabDetachable panels1 brushesPanel True
|
||||
|
||||
GTK.notebookSetTabReorderable panels2 transformPanel True
|
||||
GTK.notebookSetTabDetachable panels2 transformPanel True
|
||||
|
||||
strokesContent <- GTK.labelNew ( Just "Strokes tab content..." )
|
||||
brushesContent <- GTK.labelNew ( Just "Brushes tab content..." )
|
||||
transformContent <- GTK.labelNew ( Just "Transform tab content..." )
|
||||
|
||||
GTK.boxPackStart strokesPanel strokesContent True True 0
|
||||
GTK.boxPackStart brushesPanel brushesContent True True 0
|
||||
GTK.boxPackStart transformPanel transformContent True True 0
|
||||
|
||||
|
||||
---------------------------------------------------------
|
||||
-- Info bar
|
||||
|
|
|
@ -319,6 +319,25 @@ tooltip {
|
|||
font-size: 12px;
|
||||
}
|
||||
|
||||
.panels tab {
|
||||
padding-left: 6px;
|
||||
padding-right: 6px;
|
||||
border-top: 2px solid rgb(41, 40, 40);
|
||||
}
|
||||
|
||||
.panels tab:hover {
|
||||
border-color: rgb(72,70,61);
|
||||
}
|
||||
|
||||
.panels tab:active, .panels tab:checked {
|
||||
background-color: rgb(72,70,61);
|
||||
border-color: rgb(234,223,204);
|
||||
}
|
||||
|
||||
.panel {
|
||||
background-color: rgb(72,70,61);
|
||||
}
|
||||
|
||||
/* Info bar */
|
||||
.infoBar {
|
||||
min-height: 40px;
|
||||
|
|
Loading…
Reference in a new issue