Commit d58f01b5 authored by Bas Lijnse's avatar Bas Lijnse

Changed arrangeWithSideBar layout to css based alternative

parent c21cfae7
......@@ -438,7 +438,7 @@ communicationItemTask (contactNo,mbP2000Template) status
)
//Manage list of communication attempts and initiate communications
-&&- attemptCommunication contactNo
) <<@ ArrangeWithSideBar 0 LeftSide 200 True) <<@ ArrangeWithSideBar 0 TopSide 50 True
) <<@ ArrangeWithSideBar 0 LeftSide True) <<@ ArrangeWithHeader 0
@! ()
where
attemptCommunication contactNo
......@@ -730,7 +730,7 @@ addSubAction initContacts initIncidents list
addPredefinedAction initContacts initIncidents list
= (enterChoiceWithShared (Title "Choose action") [/*ChooseFromTree groupCatalog*/] actionCatalog
>&> \mbSel -> configureAction mbSel) <<@ (ArrangeWithSideBar 0 LeftSide 300 True)
>&> \mbSel -> configureAction mbSel) <<@ (ArrangeWithSideBar 0 LeftSide True)
where
configureAction selSds = whileUnchanged selSds configTask
where
......
......@@ -7,7 +7,7 @@ import Text.HTML
selectVideoWallContent :: Task ()
selectVideoWallContent
= (header ||- selectContent) <<@ (ArrangeWithSideBar 0 TopSide 30 False)
= (header ||- selectContent) <<@ (ArrangeWithHeader 0)
@! ()
where
header
......@@ -15,7 +15,7 @@ where
mapContacts = mapRead (\(x,y) -> x++y) (contactsOfOpenIncidentsGeo |*| contactsProvidingHelpGeo)
selectContent
= (switchContent >&> withSelection viewNoSelection configureContent) <<@ (ArrangeWithSideBar 0 LeftSide 300 False)
= (switchContent >&> withSelection viewNoSelection configureContent) <<@ (ArrangeWithSideBar 0 LeftSide False)
switchContent = enterChoice (Title "Choose Content") [ChooseFromList bigLabel] contentOptions
contentOptions
......
......@@ -12,7 +12,7 @@ wallContent = sharedStore "WallContent" (WallOverview defaultValue)
viewVideoWallContent :: Task WallContent
viewVideoWallContent
= (header ||- content) <<@ (ArrangeWithSideBar 0 TopSide 30 False) //<<@ AfterLayout plainLayoutFinal //FIXME
= (header ||- content) <<@ (ArrangeWithHeader 0) //<<@ AfterLayout plainLayoutFinal //FIXME
where
header
= viewSharedInformation () [ViewAs view] (currentTime |*| currentUTCTime) //<<@ (AfterLayout (uiDefSetHalign AlignRight o uiDefSetBaseCls "wall-header")) //FIXME
......@@ -39,7 +39,7 @@ viewWallOverview perspective
(get standardMapLayers
>>- \baseLayers ->
viewSharedInformation () [ViewAs (toMap perspective baseLayers)] mapContacts /* <<@ AfterLayout (tweakUI (setMargins 0 0 0 0 o fill))*/ ) //FIXME
) <<@ ArrangeWithSideBar 0 LeftSide 300 False
) <<@ ArrangeWithSideBar 0 LeftSide False
where
toMap perspective baseLayers contacts
= toLeafletMap {ContactMap|perspective=perspective,layers=baseLayers++[{title="Contacts",def=CMMarkersLayer [contactGeoToMapMarker False False c \\ c=:{ContactGeo|position=Just _} <- contacts]}]}
......@@ -55,8 +55,8 @@ viewWallContactSummary contactNo
= withHeader viewContactTitle
((viewDetails
-&&-
((viewPosition -&&- viewCommunication ) <<@ArrangeWithSideBar 1 RightSide 350 False)
) <<@ArrangeWithSideBar 0 LeftSide 250 False)
((viewPosition -&&- viewCommunication ) <<@ArrangeWithSideBar 1 RightSide False)
) <<@ArrangeWithSideBar 0 LeftSide False)
where
contact = sdsFocus contactNo contactByNo
......
......@@ -38,8 +38,8 @@ answerPhoneCall communicationNo
>>| connectInboundPhoneCall communicationNo
||- ((manageCommunicationContact communicationNo
-&&-
manageVoiceCallContent PhoneCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide 300 True)
<<@ ArrangeWithSideBar 0 TopSide 60 False
manageVoiceCallContent PhoneCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide True)
<<@ ArrangeWithHeader 0
<<@ Title ("Answer phone call")
/* <<@ AfterLayout (uiDefSetSize (ExactSize 800) (ExactSize 600)) */ //FIXME
@! communicationNo
......@@ -51,8 +51,8 @@ initiatePhoneCall communicationNo
>>| connectOutboundPhoneCall communicationNo
||- ((manageCommunicationContact communicationNo
-&&-
manageVoiceCallContent PhoneCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide 300 True)
<<@ ArrangeWithSideBar 0 TopSide 60 False
manageVoiceCallContent PhoneCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide True)
<<@ ArrangeWithHeader 0
<<@ Title ("Make phone call")
/* <<@ AfterLayout (uiDefSetSize (ExactSize 800) (ExactSize 600)) */ //FIXME
@! communicationNo
......@@ -64,8 +64,8 @@ answerRadioCall communicationNo
>>| updateRadioCallMeta communicationNo
||- ((manageCommunicationContact communicationNo
-&&-
manageVoiceCallContent RadioCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide 300 True)
<<@ ArrangeWithSideBar 0 TopSide 60 False
manageVoiceCallContent RadioCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide True)
<<@ ArrangeWithHeader 0
<<@ Title ("Answer radio call")
/* <<@ AfterLayout (uiDefSetSize (ExactSize 800) (ExactSize 600)) */ //FIXME
@! communicationNo
......@@ -77,8 +77,8 @@ initiateRadioCall communicationNo
>>| updateRadioCallMeta communicationNo
||- ((manageCommunicationContact communicationNo
-&&-
manageVoiceCallContent RadioCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide 300 True)
<<@ ArrangeWithSideBar 0 TopSide 60 False
manageVoiceCallContent RadioCall communicationNo) <<@ ArrangeWithSideBar 0 LeftSide True)
<<@ ArrangeWithHeader 0
<<@ Title "Initiate radio call"
/* <<@ AfterLayout (uiDefSetSize (ExactSize 800) (ExactSize 600)) */ //FIXME
@! communicationNo
......@@ -91,7 +91,7 @@ composeEmailMessage communicationNo
||- ((composeAndSendMessage communicationNo message transmitEmailMessage
-&&-
relateMessageToIncidents communicationNo) <<@ ArrangeWithTabs True)
<<@ ArrangeWithSideBar 0 TopSide 60 False
<<@ ArrangeWithHeader 0
<<@ Title "Compose E-mail"
/* <<@ AfterLayout (uiDefSetSize (ExactSize 800) (ExactSize 600) ) */ //FIXME
@! communicationNo
......@@ -106,7 +106,7 @@ composeP2000Message communicationNo
||- ((composeAndSendMessage communicationNo message transmitP2000Message
-&&-
relateMessageToIncidents communicationNo) <<@ ArrangeWithTabs True)
<<@ ArrangeWithSideBar 0 TopSide 60 False
<<@ ArrangeWithHeader 0
<<@ Title "Compose P2000 message"
/* <<@ AfterLayout (uiDefSetSize (ExactSize 800) (ExactSize 600)) */ //FIXME
@! communicationNo
......
......@@ -183,7 +183,7 @@ manageContactCommunication contactNo
= ((manageContactCommunicationMeans True contactNo) // <<@ AfterLayout (tweakUI fill)) //FIXME
-&&-
(viewContactCommunications contactNo) //<<@ AfterLayout (tweakUI fill)) //FIXME
) <<@ ArrangeWithSideBar 0 LeftSide 200 True <<@ Title "Communication" <<@ Icon "communication"
) <<@ ArrangeWithSideBar 0 LeftSide True <<@ Title "Communication" <<@ Icon "communication"
@! ()
where
viewContactCommunications contactNo
......@@ -259,7 +259,7 @@ where
Just taskId = workOnActionItem taskId @! taskId
Nothing = viewInformation () [] () @? const NoValue
)
) <<@ (ArrangeWithSideBar 0 LeftSide 250 True) <<@ (Icon "actions") <<@ (Title "Actions")
) <<@ (ArrangeWithSideBar 0 LeftSide True) <<@ (Icon "actions") <<@ (Title "Actions")
manageContactIncidents :: Workspace ContactNo -> Task ()
manageContactIncidents ws contactNo
......@@ -268,7 +268,7 @@ manageContactIncidents ws contactNo
withSelection viewNoSelection viewIncidentDetails sel
-&&-
doAddRemoveOpen (add <<@ InWindow) (\c -> (remove c) <<@ InWindow) (\c -> doOrClose (open c)) ws sel
) <<@ (ArrangeWithSideBar 1 RightSide 300 True) <<@ (Icon "incidents") <<@ (Title "Incidents")
) <<@ (ArrangeWithSideBar 1 RightSide True) <<@ (Icon "incidents") <<@ (Title "Incidents")
@! ()
where
incidents = sdsFocus contactNo incidentsByContactDetails
......
......@@ -62,7 +62,7 @@ manageIncidentContacts ws incidentNo
@! ()
where
contacts = sdsFocus incidentNo contactsByIncident
manageContacts = ((withShared Nothing (\sel -> (chooseFromList sel -||- chooseFromMap sel) <<@ (ArrangeWithSideBar 0 LeftSide 250 True))))
manageContacts = ((withShared Nothing (\sel -> (chooseFromList sel -||- chooseFromMap sel) <<@ (ArrangeWithSideBar 0 LeftSide True))))
>^* [(OnAction (Action "/Add contact") (always (add <<@ InWindow @! ())))
,(OnAction (Action "/Remove contact") (ifValue (\c -> c=:(Left _)) (\(Left c) -> (remove c <<@ InWindow @! ()))))
,(OnAction (Action "/Update position") (ifValue (\c -> c=:(Left _)) (\(Left c) -> updateContactPosition c <<@ InWindow @! ())))
......@@ -108,13 +108,13 @@ where
Just taskId = workOnActionItem taskId
Nothing = viewInformation () [] ()
)
)) <<@ (ArrangeWithSideBar 0 LeftSide 250 True) <<@ (Icon "actions") <<@ (Title "Incident Actions") //FIXME
)) <<@ (ArrangeWithSideBar 0 LeftSide True) <<@ (Icon "actions") <<@ (Title "Incident Actions") //FIXME
manageIncidentWeather :: IncidentNo -> Task ()
manageIncidentWeather incidentNo
= (get webLinksConfig
>>- \webConfig -> case webConfig.weatherWidgets of
Just widgets = (viewWebWeather widgets ||- viewOrEdit (Title "Weather on scene") weather log) <<@ (ArrangeWithSideBar 0 RightSide 300 True)
Just widgets = (viewWebWeather widgets ||- viewOrEdit (Title "Weather on scene") weather log) <<@ (ArrangeWithSideBar 0 RightSide True)
Nothing = viewOrEdit (Title "Weather on scene") weather log
) <<@ Title "Weather" <<@ Icon "weather"
......@@ -126,7 +126,7 @@ where
manageIncidentLog :: IncidentNo -> Task ()
manageIncidentLog incidentNo
= addMessages incidentNo
||- viewIncidentLog incidentNo <<@ ArrangeWithSideBar 0 TopSide 100 False <<@ Title "Log" <<@ Icon "Log"
||- viewIncidentLog incidentNo <<@ ArrangeWithHeader 0 <<@ Title "Log" <<@ Icon "Log"
@! ()
where
viewIncidentLog :: IncidentNo -> Task [LogEntry]
......
......@@ -108,7 +108,7 @@ where
catchAll (
viewSharedInformation (Title ("Schema of"+++ table)) [] (sdsFocus (db,table) sqlTableDefinition) @! ()
) (\e -> viewInformation () [] e @! ())
) <<@ (ArrangeWithSideBar 0 LeftSide 300 True)
) <<@ (ArrangeWithSideBar 0 LeftSide True)
where
//group items _ = [{ChoiceTree|defaultValue & label=o,value=ChoiceNode i}\\(i,o) <- items]
......@@ -143,7 +143,7 @@ where
manageExistingUsers
= (enterChoiceWithSharedAs () [ChooseFromGrid id] allContactsShort contactIdentity
>&> withSelection viewNoSelection manageContactAccess
)<<@ ArrangeWithSideBar 0 LeftSide 200 True
)<<@ ArrangeWithSideBar 0 LeftSide True
viewNoSelection = viewInformation "Select a user" [] ()
addUser
......
......@@ -52,7 +52,7 @@ browseIncidents ws
]
)
( withSelection viewNoSelection viewIncidentDetails
) <<@ (ArrangeWithSideBar 1 RightSide 300 True) <<@ (Icon "incidents") <<@ (Title "Incidents")
) <<@ (ArrangeWithSideBar 1 RightSide True) <<@ (Icon "incidents") <<@ (Title "Incidents")
@! ()
where
selectIncident
......@@ -74,7 +74,7 @@ browseContacts ws
]
)
( withSelection viewNoSelection viewDetails
) <<@ (ArrangeWithSideBar 1 RightSide 300 True) <<@ (Icon "contacts") <<@ (Title "Contacts")
) <<@ (ArrangeWithSideBar 1 RightSide True) <<@ (Icon "contacts") <<@ (Title "Contacts")
@! ()
where
viewDetails (Left contactNo) = viewContactDetails contactNo
......@@ -109,7 +109,7 @@ where
Just taskId = workOnActionItem taskId
Nothing = viewInformation () [] ()
)
) <<@ (ArrangeWithSideBar 0 LeftSide 250 True) <<@ (Icon "actions") <<@ (Title "Actions")
) <<@ (ArrangeWithSideBar 0 LeftSide True) <<@ (Icon "actions") <<@ (Title "Actions")
......@@ -83,7 +83,7 @@ where
whileAuthenticated :: User [Workspace -> Task ()] -> Task ()
whileAuthenticated user tasks
= (controlDash -|| workOnTasks) <<@ (ArrangeWithSideBar 0 TopSide 30 False)
= (controlDash -|| workOnTasks) <<@ (ArrangeWithHeader 0)
where
controlDash = (
viewInformation () [] ("Welcome " +++ toString user)
......@@ -99,6 +99,6 @@ where
,moveSubUIs (SelectByPath [0,0]) [] 2
,removeSubUIs (SelectByPath [0])
,layoutSubUIs (SelectByType UIAction) actionToButton
,setUIAttributes ('DM'.unions [directionAttr Horizontal,paddingAttr 2 2 2 250, classAttr "summary-bar"])
,setUIAttributes ('DM'.unions [directionAttr Horizontal,paddingAttr 2 2 2 250, classAttr ["summary-bar"]])
,setUIType UIContainer
]
......@@ -224,7 +224,7 @@ where
, moveSubAt[2] [1,0]
, moveSubAt[2] [1,1]
, moveSubAt[2] [1,2]
, arrangeWithSideBar 1 LeftSide 350 False //Move the 'tool' tasks to the side
, arrangeWithSideBar 1 LeftSide False //Move the 'tool' tasks to the side
]
*/
......@@ -292,7 +292,7 @@ editSectionContents
,moveSubAt [2] [1,0]
,moveSubAt [2] [1,1]
,moveSubAt [2] [1,2]
,arrangeWithSideBar 1 BottomSide 250 False
,arrangeWithSideBar 1 BottomSide False
]
*/
......
......@@ -36,7 +36,7 @@ whileAuthenticated :: User [Entity]
(User -> [(String, User [Entity] -> Task ())])
-> Task ()
whileAuthenticated user ents alwaysOnTasks tlist
= controlDash -|| workOnTasks <<@ ApplyLayout (arrangeWithSideBar 0 TopSide 30 False)
= controlDash -|| workOnTasks <<@ ApplyLayout (arrangeWithHeader 0)
where
controlDash :: Task ()
controlDash
......@@ -61,7 +61,7 @@ whileAuthenticated user ents alwaysOnTasks tlist
layout = sequenceLayouts
[removeSubUIs (SelectByPath [1]) //Don't show the openAssignedTasks UI
,arrangeWithSideBar 0 RightSide 300 True
,arrangeWithSideBar 0 RightSide True
,layoutSubUIs (SelectByPath [0]) (arrangeWithTabs True)
]
......
......@@ -117,30 +117,30 @@ doTasksSequentially [t:ts] = t >>| doTasksSequentially ts
allTabs :: [Task a] -> (Task [a]) | iTask a
allTabs ts = allTasks ts <<@ ArrangeWithTabs True
allSideBar :: Int UISide Int [Task a] -> (Task [a]) | iTask a
allSideBar b place size ts
= allTasks ts <<@ (ArrangeWithSideBar b place size True)
allSideBar :: Int UISide [Task a] -> (Task [a]) | iTask a
allSideBar b place ts
= allTasks ts <<@ (ArrangeWithSideBar b place True)
c2view :: (Task a) (Task ()) [Task c] [Task d] -> Task () | iTask a & iTask c & iTask d
c2view main top left right
= allSideBar 0 TopSide 30
= allSideBar 0 TopSide
[ top
, splitscreenview main left right
] @! ()
splitscreenview main left right
= allSideBar 1 RightSide 300
= allSideBar 1 RightSide
[ innersplitscreenview main left
, sidebar right
] @! ()
innersplitscreenview main left
= allSideBar 0 LeftSide 25
= allSideBar 0 LeftSide
[ sidebar left
, main @! ()
] @! ()
sidebar ts = allSideBar 0 TopSide 25 ts @! ()
sidebar ts = allSideBar 0 TopSide ts @! ()
chats :: SimpleSDSLens [ChatMessage]
chats = sharedStore "chats" []
......
......@@ -29,7 +29,7 @@ viewSelectedCitizen :: Task ()
viewSelectedCitizen
= (enterChoiceWithShared () [ChooseFromGrid (\{Citizen|name,ssn} -> "" <+++ name <+++ " (" <+++ ssn <+++ ")") ] citizens
>&> withSelection (viewInformation () [] "Select a citizen")
(\citizen -> viewCitizenInformation citizen.Citizen.ssn defaultValue) )<<@ ApplyLayout (arrangeWithSideBar 0 LeftSide 200 True)
(\citizen -> viewCitizenInformation citizen.Citizen.ssn defaultValue) )<<@ ApplyLayout (arrangeWithSideBar 0 LeftSide True)
viewCitizenInformation :: SSN Date -> Task ()
viewCitizenInformation ssn date
......
......@@ -13,7 +13,7 @@ crudWith descr choiceOpts enterOpts viewOpts updateOpts toList putItem delItem s
where
crud
= ( enterChoiceWithShared descr [ChooseFromGrid id:choiceOpts] (mapRead toList sh)
>&^ viewSharedInformation (Title "Selected") []) <<@ ApplyLayout (arrangeWithSideBar 1 RightSide 350 True)
>&^ viewSharedInformation (Title "Selected") []) <<@ ApplyLayout (arrangeWithSideBar 1 RightSide True)
>>* [ OnAction (Action "New") (always newItem)
, OnAction (Action "Edit") (hasValue editItem)
, OnAction (Action "Delete") (hasValue deleteItem)
......
......@@ -10,7 +10,7 @@ playWithMaps = withShared {defaultValue & icons = shipIcons} (\m ->
(allTasks [managePerspective m, manageMapObjects m])
-&&-
manipulateMap m
) <<@ ArrangeWithSideBar 0 LeftSide 600 True @! ()
) <<@ ArrangeWithSideBar 0 LeftSide True @! ()
manipulateMap :: (Shared sds LeafletMap) -> Task () | RWShared sds
manipulateMap m = updateSharedInformation () [] m
......
......@@ -63,7 +63,7 @@ tonicStaticBrowser rs
>&> withSelection noModuleSelection (
\mn -> getModule mn
>>- \tm -> tonicBrowseWithModule allbps rs navstack tm
)) <<@ ArrangeWithSideBar 0 LeftSide 200 True
)) <<@ ArrangeWithSideBar 0 LeftSide True
)) ) @! ()
where
selectModule = getTonicModules >>- enterChoice "Select a module" [ChooseFromDropdown id]
......@@ -84,7 +84,7 @@ tonicBrowseWithModule allbps rs navstack tm
, bpr_taskName = tt.tf_name
} tm tt sett.StaticDisplaySettings.unfold_depth sett.StaticDisplaySettings.display_compact @! ()))
(getTonicFunc tm tn)
)) <<@ ArrangeWithSideBar 0 LeftSide 200 True
)) <<@ ArrangeWithSideBar 0 LeftSide True
@! ()
where
selectTask tm = enterChoice "Select task" [ChooseFromDropdown id] (getTasks tm)
......@@ -290,7 +290,7 @@ where
(Title "Active blueprint instances")
[ChooseFromGrid customView]
(mapRead (\(trt, q) -> filterActiveTasks q (flattenRTMap trt)) (tonicSharedRT |*| queryShare))
setTaskId selectedBlueprint <<@ ArrangeWithSideBar 0 TopSide 175 True
setTaskId selectedBlueprint <<@ ArrangeWithSideBar 0 TopSide True
where
setTaskId x = { click_origin_mbbpident = Nothing
, click_origin_mbnodeId = Nothing
......
......@@ -145,7 +145,7 @@ manageWorkOfCurrentUser
where
layout = sequenceLayouts
[unwrapUI //Get rid of the step
,arrangeWithSideBar 0 TopSide 50 False
,arrangeWithHeader 0
,layoutSubUIs (SelectByPath [0]) layoutManageSession
,layoutSubUIs (SelectByPath [1]) (sequenceLayouts [unwrapUI,layoutWhatToDo])
//Use maximal screen space
......@@ -158,7 +158,7 @@ where
,setUIType UIContainer
,setUIAttributes ('DM'.unions [heightAttr WrapSize,directionAttr Horizontal,paddingAttr 2 2 2 10])
]
layoutWhatToDo = sequenceLayouts [arrangeWithSideBar 0 LeftSide 150 True, layoutSubUIs (SelectByPath [1]) unwrapUI]
layoutWhatToDo = sequenceLayouts [arrangeWithSideBar 0 LeftSide True, layoutSubUIs (SelectByPath [1]) unwrapUI]
manageSession :: Task ()
manageSession =
......@@ -197,9 +197,9 @@ where
layoutManageWork = sequenceLayouts
//Split the screen space
[ arrangeWithSideBar 0 TopSide 200 True
[ arrangeWithSideBar 0 TopSide True
//Layout all dynamically added tasks as tabs
, layoutSubUIs (SelectByPath [1]) (arrangeWithTabs False)
, layoutSubUIs (SelectByPath [1]) (arrangeWithTabs True)
, layoutSubUIs (SelectByPath [1]) $
layoutSubUIs (SelectByDepth 1) (setUIAttributes $ 'DM'.put "fullscreenable" (JSONBool True) 'DM'.newMap)
]
......
......@@ -10,21 +10,33 @@ from iTasks.UI.Prompt import :: Title, :: Label, :: Icon
from iTasks.WF.Definition import :: Task
from iTasks.WF.Combinators.Tune import class tune
/**
* Add a CSS class to customize styling
*/
addCSSClass :: String -> LayoutRule
/**
* Create a tabset with all child items as separate tabs
* The flag denotes whether close buttons should be lifted to the tabs
*/
arrangeWithTabs :: Bool -> LayoutRule
/**
* Extract one child item and put it in a separate 'header' panel on top of the screen
*
* @param Index of the task in the set that will be used as header
*/
arrangeWithHeader :: !Int -> LayoutRule
/**
* Extract one child item and put it in a separate panel at the side of the screen
*
* @param Index of the task in the set that should be put in the sidebar
* @param Location of the sidebar
* @param Initial size of the sidebar
* @param Enable resize?
*/
arrangeWithSideBar :: !Int !UISide !Int !Bool -> LayoutRule
arrangeWithSideBar :: !Int !UISide !Bool -> LayoutRule
/**
* Lift actions starting with / to the menu
......@@ -66,9 +78,12 @@ insertToolBar :: [String] -> LayoutRule
:: ArrangeWithTabs = ArrangeWithTabs Bool
instance tune ArrangeWithTabs Task
:: ArrangeWithSideBar = ArrangeWithSideBar !Int !UISide !Int !Bool
:: ArrangeWithSideBar = ArrangeWithSideBar !Int !UISide !Bool
instance tune ArrangeWithSideBar Task
:: ArrangeWithHeader = ArrangeWithHeader !Int
instance tune ArrangeWithHeader Task
:: ArrangeAsMenu = ArrangeAsMenu [[Int]]
instance tune ArrangeAsMenu Task
......
......@@ -17,6 +17,14 @@ import qualified Data.Foldable
import qualified Text as T
from Text import class Text, instance Text String
addCSSClass :: String -> LayoutRule
addCSSClass className = modifyUIAttributes (SelectKeys ["class"]) add
where
add attr = 'DM'.put "class" (maybe
(JSONArray [JSONString className])
(\(JSONArray classNames) -> JSONArray (classNames ++ [JSONString className]))
('DM'.get "class" attr)) attr
arrangeWithTabs :: Bool -> LayoutRule
arrangeWithTabs closeable = layoutSubUIs
(SelectAND (SelectByPath []) (SelectByType UIParallel))
......@@ -51,8 +59,13 @@ where
,removeSubUIs (SelectByPath [0])
]
arrangeWithSideBar :: !Int !UISide !Int !Bool -> LayoutRule
arrangeWithSideBar index side size resize = sequenceLayouts
arrangeWithHeader :: !Int -> LayoutRule
arrangeWithHeader index = setAside "itasks-headerbar" index TopSide False
arrangeWithSideBar :: !Int !UISide !Bool -> LayoutRule
arrangeWithSideBar index side resize = setAside "itasks-sidebar" index side resize
setAside className index side resize = sequenceLayouts
[wrapUI UIPanel //Push the current container down a level
,copySubUIAttributes SelectAll [0] [] //Keep the attributes from the original UI
,setUIAttributes (directionAttr direction)
......@@ -60,14 +73,16 @@ arrangeWithSideBar index side size resize = sequenceLayouts
,layoutSubUIs (SelectByPath [sidePanelIndex]) (sequenceLayouts
(if resize
[wrapUI UIPanel
,setUIAttributes (sizeAttr sidePanelWidth sidePanelHeight)
,addCSSClass className
,setUIAttributes (resizableAttr (resizers side))
]
[setUIAttributes (sizeAttr sidePanelWidth sidePanelHeight)]
))
[addCSSClass className]
)
)
]
where
sidePanelIndex = if (side === TopSide || side === LeftSide) 0 1
mainPanelIndex = if (side === TopSide || side === LeftSide) 1 0
direction = if (side === TopSide|| side === BottomSide) Vertical Horizontal
resizers TopSide = [BottomSide]
......@@ -75,8 +90,6 @@ where
resizers LeftSide = [RightSide]
resizers RightSide = [LeftSide]
(sidePanelWidth,sidePanelHeight) = if (direction === Vertical) (FlexSize,ExactSize size) (ExactSize size,FlexSize)
arrangeAsMenu :: [[Int]] -> LayoutRule
arrangeAsMenu seps = sequenceLayouts
// Wrap in panel
......@@ -170,9 +183,9 @@ arrangeHorizontal = setUIAttributes (directionAttr Horizontal)
frameCompact :: LayoutRule
frameCompact = sequenceLayouts
[setUIAttributes ('DM'.unions [classAttr ["itasks-frame-compact"],sizeAttr WrapSize WrapSize])
[addCSSClass "itasks-frame-compact-inner"
,wrapUI UIContainer
,setUIAttributes (halignAttr AlignCenter)
,addCSSClass "itasks-frame-compact-outer"
]
toWindow :: UIWindowType UIVAlign UIHAlign -> LayoutRule
......@@ -259,7 +272,11 @@ where tune (ArrangeWithTabs b) t = tune (ApplyLayout (arrangeWithTabs b)) t
instance tune ArrangeWithSideBar Task
where
tune (ArrangeWithSideBar index side size resize) t = tune (ApplyLayout (arrangeWithSideBar index side size resize)) t
tune (ArrangeWithSideBar index side resize) t = tune (ApplyLayout (arrangeWithSideBar index side resize)) t
instance tune ArrangeWithHeader Task
where
tune (ArrangeWithHeader index) t = tune (ApplyLayout (arrangeWithHeader index)) t
instance tune ArrangeAsMenu Task
where
......
......@@ -398,11 +398,18 @@ div.itasks-exception {
margin-left: 5px;
}
.itasks-frame-compact {
.itasks-frame-compact-outer {
flex: 1;
align-self: stretch;
}
.itasks-container > .itasks-frame-compact-inner {
margin: 50px 0 20px 0;
border-radius: 5px;
overflow: hidden;
min-width: 600px;
align-self: center;
flex: 0;
flex-basis: content;
}
.itasks-header {
......@@ -436,6 +443,13 @@ div.itasks-exception {
flex: 1;
}
/* Minimal containers */
.itasks-container {
/* Default flexible sizes */
flex: 1;
align-self: stretch;
}