mirror of
https://github.com/fjvallarino/monomer.git
synced 2024-11-13 00:11:06 +03:00
Move Single, Container and Composite to Widgets package
This commit is contained in:
parent
3fe72d9b2d
commit
33b66b939e
@ -19,7 +19,6 @@ import TextShow
|
||||
|
||||
import qualified Data.Sequence as Seq
|
||||
|
||||
import Monomer.Core.Composite
|
||||
import Monomer.Core.Style
|
||||
import Monomer.Core.Types
|
||||
import Monomer.Core.Util
|
||||
|
@ -16,7 +16,6 @@ import Monomer.Core.Combinators
|
||||
import Monomer.Core.Style
|
||||
import Monomer.Graphics.Color
|
||||
import Monomer.Main.Util
|
||||
import Monomer.Core.Composite
|
||||
import Monomer.Core.Types
|
||||
import Monomer.Core.Util
|
||||
import Monomer.Widgets
|
||||
|
@ -23,7 +23,6 @@ import qualified SDL
|
||||
import qualified Data.Sequence as Seq
|
||||
|
||||
import Monomer.Core.BasicTypes
|
||||
import Monomer.Core.Composite
|
||||
import Monomer.Core.Style
|
||||
import Monomer.Core.Types
|
||||
import Monomer.Event.Core
|
||||
@ -36,6 +35,7 @@ import Monomer.Main.Util
|
||||
import Monomer.Main.WidgetTask
|
||||
import Monomer.Graphics.NanoVGRenderer
|
||||
import Monomer.Graphics.Types
|
||||
import Monomer.Widgets.Composite
|
||||
|
||||
data MainLoopArgs s e = MainLoopArgs {
|
||||
_mlOS :: Text,
|
||||
|
@ -2,6 +2,7 @@ module Monomer.Widgets (
|
||||
module Monomer.Widgets.Box,
|
||||
module Monomer.Widgets.Button,
|
||||
module Monomer.Widgets.Checkbox,
|
||||
module Monomer.Widgets.Composite,
|
||||
module Monomer.Widgets.Dropdown,
|
||||
module Monomer.Widgets.FloatingField,
|
||||
module Monomer.Widgets.Grid,
|
||||
@ -20,6 +21,7 @@ module Monomer.Widgets (
|
||||
import Monomer.Widgets.Box
|
||||
import Monomer.Widgets.Button
|
||||
import Monomer.Widgets.Checkbox
|
||||
import Monomer.Widgets.Composite
|
||||
import Monomer.Widgets.Dropdown
|
||||
import Monomer.Widgets.FloatingField
|
||||
import Monomer.Widgets.Grid
|
||||
|
@ -15,12 +15,12 @@ import Data.Maybe
|
||||
import qualified Data.Sequence as Seq
|
||||
|
||||
import Monomer.Core.BasicTypes
|
||||
import Monomer.Core.BaseContainer
|
||||
import Monomer.Core.Combinators
|
||||
import Monomer.Core.Internal
|
||||
import Monomer.Core.Types
|
||||
import Monomer.Core.Util
|
||||
import Monomer.Event.Types
|
||||
import Monomer.Widgets.Container
|
||||
|
||||
data BoxCfg s e = BoxCfg {
|
||||
_boxExpandContent :: Maybe Bool,
|
||||
|
@ -12,7 +12,6 @@ import Data.Default
|
||||
import Data.Maybe
|
||||
import Data.Text (Text)
|
||||
|
||||
import Monomer.Core.BaseSingle
|
||||
import Monomer.Core.BasicTypes
|
||||
import Monomer.Core.Combinators
|
||||
import Monomer.Core.Style
|
||||
@ -21,6 +20,7 @@ import Monomer.Core.Util
|
||||
import Monomer.Event.Types
|
||||
import Monomer.Graphics.Drawing
|
||||
import Monomer.Graphics.Types
|
||||
import Monomer.Widgets.Single
|
||||
|
||||
data ButtonCfg s e = ButtonCfg {
|
||||
_btnTextOverflow :: Maybe TextOverflow,
|
||||
|
@ -15,7 +15,6 @@ import Control.Monad
|
||||
import Data.Default
|
||||
import Data.Text (Text)
|
||||
|
||||
import Monomer.Core.BaseSingle
|
||||
import Monomer.Core.BasicTypes
|
||||
import Monomer.Core.Combinators
|
||||
import Monomer.Core.Style
|
||||
@ -26,6 +25,7 @@ import Monomer.Event.Keyboard
|
||||
import Monomer.Event.Types
|
||||
import Monomer.Graphics.Drawing
|
||||
import Monomer.Graphics.Types
|
||||
import Monomer.Widgets.Single
|
||||
|
||||
data CheckboxCfg s e = CheckboxCfg {
|
||||
_ckcOnChange :: [Bool -> e],
|
||||
|
@ -2,7 +2,7 @@
|
||||
{-# LANGUAGE MultiWayIf #-}
|
||||
{-# LANGUAGE RecordWildCards #-}
|
||||
|
||||
module Monomer.Core.Composite (
|
||||
module Monomer.Widgets.Composite (
|
||||
EventResponse(..),
|
||||
EventHandler,
|
||||
UIBuilder,
|
@ -4,7 +4,7 @@
|
||||
{-# LANGUAGE RecordWildCards #-}
|
||||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
|
||||
module Monomer.Core.BaseContainer (
|
||||
module Monomer.Widgets.Container (
|
||||
Container(..),
|
||||
createContainer,
|
||||
initWrapper,
|
@ -24,7 +24,6 @@ import Data.Typeable (Typeable, cast)
|
||||
import qualified Data.Map as M
|
||||
import qualified Data.Sequence as Seq
|
||||
|
||||
import Monomer.Core.BaseContainer
|
||||
import Monomer.Core.BasicTypes
|
||||
import Monomer.Core.Combinators
|
||||
import Monomer.Core.Internal
|
||||
@ -36,6 +35,7 @@ import Monomer.Event.Types
|
||||
import Monomer.Graphics.Color
|
||||
import Monomer.Graphics.Drawing
|
||||
import Monomer.Graphics.Types
|
||||
import Monomer.Widgets.Container
|
||||
import Monomer.Widgets.Label
|
||||
import Monomer.Widgets.ListView
|
||||
|
||||
|
@ -9,12 +9,12 @@ import Data.Sequence (Seq(..), (|>))
|
||||
|
||||
import qualified Data.Sequence as Seq
|
||||
|
||||
import Monomer.Core.BaseContainer
|
||||
import Monomer.Core.BasicTypes
|
||||
import Monomer.Core.Internal
|
||||
import Monomer.Core.Style
|
||||
import Monomer.Core.Types
|
||||
import Monomer.Core.Util
|
||||
import Monomer.Widgets.Container
|
||||
|
||||
hgrid :: (Traversable t) => t (WidgetInstance s e) -> WidgetInstance s e
|
||||
hgrid children = (defaultWidgetInstance "hgrid" (makeFixedGrid True)) {
|
||||
|
@ -26,7 +26,6 @@ import qualified Codec.Picture as Pic
|
||||
import qualified Data.ByteString.Lazy as BSL
|
||||
import qualified Network.Wreq as Wreq
|
||||
|
||||
import Monomer.Core.BaseSingle
|
||||
import Monomer.Core.BasicTypes
|
||||
import Monomer.Core.Combinators
|
||||
import Monomer.Core.Style
|
||||
@ -34,6 +33,7 @@ import Monomer.Core.Types
|
||||
import Monomer.Core.Util
|
||||
import Monomer.Graphics.Drawing
|
||||
import Monomer.Graphics.Types
|
||||
import Monomer.Widgets.Single
|
||||
|
||||
data ImageFit
|
||||
= FitNone
|
||||
|
@ -18,7 +18,6 @@ import Data.Typeable
|
||||
import qualified Data.Sequence as Seq
|
||||
import qualified Data.Text as T
|
||||
|
||||
import Monomer.Core.BaseSingle
|
||||
import Monomer.Core.BasicTypes
|
||||
import Monomer.Core.Style
|
||||
import Monomer.Core.StyleUtil
|
||||
@ -28,6 +27,7 @@ import Monomer.Event.Keyboard
|
||||
import Monomer.Event.Types
|
||||
import Monomer.Graphics.Drawing
|
||||
import Monomer.Graphics.Types
|
||||
import Monomer.Widgets.Single
|
||||
|
||||
import qualified Monomer.Core.Lens.Style as S
|
||||
|
||||
|
@ -8,7 +8,6 @@ import Data.Default
|
||||
import Data.Maybe
|
||||
import Data.Text (Text)
|
||||
|
||||
import Monomer.Core.BaseSingle
|
||||
import Monomer.Core.BasicTypes
|
||||
import Monomer.Core.Combinators
|
||||
import Monomer.Core.Style
|
||||
@ -16,6 +15,7 @@ import Monomer.Core.Types
|
||||
import Monomer.Core.Util
|
||||
import Monomer.Graphics.Drawing
|
||||
import Monomer.Graphics.Types
|
||||
import Monomer.Widgets.Single
|
||||
|
||||
newtype LabelCfg = LabelCfg {
|
||||
_lscTextOverflow :: Maybe TextOverflow
|
||||
|
@ -24,7 +24,6 @@ import Data.Typeable (Typeable, cast)
|
||||
|
||||
import qualified Data.Sequence as Seq
|
||||
|
||||
import Monomer.Core.BaseContainer
|
||||
import Monomer.Core.BasicTypes
|
||||
import Monomer.Core.Combinators
|
||||
import Monomer.Core.Style
|
||||
@ -36,6 +35,7 @@ import Monomer.Graphics.Color
|
||||
import Monomer.Graphics.Drawing
|
||||
import Monomer.Graphics.Types
|
||||
import Monomer.Widgets.Box
|
||||
import Monomer.Widgets.Container
|
||||
import Monomer.Widgets.Label
|
||||
import Monomer.Widgets.Scroll
|
||||
import Monomer.Widgets.Spacer
|
||||
|
@ -15,7 +15,6 @@ import Control.Monad
|
||||
import Data.Default
|
||||
import Data.Text (Text)
|
||||
|
||||
import Monomer.Core.BaseSingle
|
||||
import Monomer.Core.BasicTypes
|
||||
import Monomer.Core.Combinators
|
||||
import Monomer.Core.Style
|
||||
@ -26,6 +25,7 @@ import Monomer.Event.Keyboard
|
||||
import Monomer.Event.Types
|
||||
import Monomer.Graphics.Drawing
|
||||
import Monomer.Graphics.Types
|
||||
import Monomer.Widgets.Single
|
||||
|
||||
data RadioCfg s e a = RadioCfg {
|
||||
_rdcOnChange :: [a -> e],
|
||||
|
@ -19,7 +19,6 @@ import Data.Typeable
|
||||
|
||||
import qualified Data.Sequence as Seq
|
||||
|
||||
import Monomer.Core.BaseContainer
|
||||
import Monomer.Core.BasicTypes
|
||||
import Monomer.Core.Internal
|
||||
import Monomer.Core.Style
|
||||
@ -29,6 +28,7 @@ import Monomer.Event.Types
|
||||
import Monomer.Graphics.Color
|
||||
import Monomer.Graphics.Drawing
|
||||
import Monomer.Graphics.Types
|
||||
import Monomer.Widgets.Container
|
||||
|
||||
data ActiveBar
|
||||
= HBar
|
||||
|
@ -2,7 +2,7 @@
|
||||
{-# LANGUAGE RankNTypes #-}
|
||||
{-# LANGUAGE RecordWildCards #-}
|
||||
|
||||
module Monomer.Core.BaseSingle (
|
||||
module Monomer.Widgets.Single (
|
||||
Single(..),
|
||||
createSingle
|
||||
) where
|
@ -7,12 +7,12 @@ import Control.Applicative ((<|>))
|
||||
import Data.Default
|
||||
import Data.Maybe
|
||||
|
||||
import Monomer.Core.BaseSingle
|
||||
import Monomer.Core.BasicTypes
|
||||
import Monomer.Core.Combinators
|
||||
import Monomer.Core.Style
|
||||
import Monomer.Core.Types
|
||||
import Monomer.Core.Util
|
||||
import Monomer.Widgets.Single
|
||||
|
||||
data SpacerCfg = SpacerCfg {
|
||||
_spcWidth :: Maybe Double,
|
||||
|
@ -10,12 +10,12 @@ import Data.Sequence (Seq(..), (<|), (|>))
|
||||
|
||||
import qualified Data.Sequence as Seq
|
||||
|
||||
import Monomer.Core.BaseContainer
|
||||
import Monomer.Core.BasicTypes
|
||||
import Monomer.Core.Internal
|
||||
import Monomer.Core.Style
|
||||
import Monomer.Core.Types
|
||||
import Monomer.Core.Util
|
||||
import Monomer.Widgets.Container
|
||||
|
||||
hstack :: (Traversable t) => t (WidgetInstance s e) -> WidgetInstance s e
|
||||
hstack children = (defaultWidgetInstance "hstack" (makeStack True)) {
|
||||
|
3
tasks.md
3
tasks.md
@ -200,7 +200,8 @@
|
||||
- Widget.Widgets moved to Widget?
|
||||
- WidgetCombinators and StyleCombinators merged into a single Combinators?
|
||||
- Create Lens package. BasicTypes lenses should also be there
|
||||
- Create separate Util/WidgetUtil
|
||||
- Create separate Util/WidgetUtil (rename Types to WidgetTypes)
|
||||
- Simplify imports
|
||||
- WidgetRequest for error messages? Probably not worth it
|
||||
- Maybe provide a config where a notification/lens can be sent?
|
||||
- Make sure that focus change requests do not leave overlay if active (most likely an if clause is needed in handleFocusChange)
|
||||
|
Loading…
Reference in New Issue
Block a user