#
# This file is a part of the NsCDE - Not so Common Desktop Environment
# Author: Hegel3DReloaded
# Licence: GPLv3
#

########
# Styles
########

Style * MinOverlapPlacement, !UsePPosition, SnapGrid, \
        GrabFocusOff, FPGrabFocusTransient, FPReleaseFocusTransient, \
        Colorset 1, HilightColorset 2, BorderColorset 1, HilightBorderColorset 2, \
        IconBackgroundColorset 18, IconTitleColorset 1, HilightIconTitleColorset 2, \
        IconTitleRelief 2, IconBackgroundRelief 0, IconBackgroundPadding 6, \
        !StickyStippledIconTitle, StickyAcrossPagesIcon, \
        Icon NsCDE/Noicon.xpm, MiniIcon NsCDE/Nominiicon.xpm, \
        IconFont "$[infostore.font.variable.normal.medium]", \
        Font "$[infostore.font.variable.normal.medium]", \
        MwmFunctions, MwmDecor, MwmButtons, MwmBorder, HintOverride, \
        BorderWidth 5, HandleWidth 5, DepressableBorder, \
        DecorateTransient, StartsOnScreen c, WindowShadeSteps 48, \
        EdgeResizeDelay 1000, SnapAttraction 2 SameType ScreenAll, \
        EWMHMaximizeUseWorkingArea

Test (f $[FVWM_USERDIR]/Style.override) Read $[FVWM_USERDIR]/Style.override

##################################
# Fvwm Modules and Scripts
##################################
# 1. General catch-many defaults
Style Fvwm* Title, Slippery, NoButton 2, NoButton 4, NoHandles, BorderWidth 5, Font "$[infostore.font.variable.normal.medium]"
Style FvwmIdent Icon NsCDE/Dthinfo.l.pm, MiniIcon NsCDE/Dthinfo.t.pm
Style FvwmPager NoIcon, WindowListSkip, CirculateSkip
Style FvwmForm Handles, Title
Style FvwmScript FixedSize, Title, !Maximizable, MinOverlapPlacement
Style FvwmIconMan NoTitle, Sticky, WindowListSkip
Style fvwm_menu NoHandles, UsePPosition, NoButton 2, NoButton 4, Icon NsCDE/DtTypeEditor.l.pm
# 2. Applications
Style "WSM" NoTitle, NoHandles, BorderWidth 0, WindowListSkip, PositionPlacement +30000p +30000p
Style "WSM-*" NoTitle, NoHandles, BorderWidth 0, WindowListSkip, PositionPlacement +30000p +30000p
Style "ExecDialog" Icon NsCDE/Dtexec.l.pm, MiniIcon NsCDE/Dtexec.t.pm, FPGrabFocus, InitialMapCommand Schedule 100 WarpToWindow 50 44
Style "SysActionDialog" Icon NsCDE/48x48/actions/exit.png, MiniIcon NsCDE/16x16/actions/exit.png, Sticky, FPGrabFocus, PositionPlacement Center, StaysOnTop
Style "StyleMgr" Button 4, Icon NsCDE/Fpstyle.l.pm, MiniIcon NsCDE/Dtstyle.t.pm, PositionPlacement +96p +4p
Style "FontMgr" Icon NsCDE/DtFont.l.pm, MiniIcon NsCDE/DtFont.t.pm
Style "ColorMgr" Icon NsCDE/DtColor.l.pm, MiniIcon NsCDE/DtColor.t.pm
Style "BackdropMgr" Icon NsCDE/DtBkdrp.l.pm, MiniIcon NsCDE/DtBkdrp.t.pm
Style "WindowMgr" Icon NsCDE/DtDtwm.l.pm, MiniIcon NsCDE/DtDtwm.t.pm
Style "BeepMgr" Icon NsCDE/Dtaudio.l.pm, MiniIcon NsCDE/Dtaudio.t.pm
Style "PointerMgr" Icon NsCDE/DtMouse.l.pm, MiniIcon NsCDE/DtMouse.t.pm
Style "PowerSaveMgr" Icon NCDE/Dtpowermgr.l.pm, MiniIcon NsCDE/Dtpowermgr.t.pm
Style "KeyboardMgr" Icon NsCDE/DtKeybd.l.pm, MiniIcon NsCDE/DtKeybd.t.pm
Style "SubpanelMgr" Icon NsCDE/DtFpSubMenu.l.xpm, MiniIcon NsCDE/DtFpSubMenu.t.xpm, PositionPlacement UnderMouse, InitialMapCommand Move keep w-8
Style "FpIconMgr" Icon NsCDE/DtFpSubMenu.l.xpm, MiniIcon NsCDE/DtFpSubMenu.t.xpm, PositionPlacement UnderMouse
Style "SubpanelSettings" Icon NsCDE/DtFpSubMenu.l.xpm, MiniIcon NsCDE/DtFpSubMenu.t.xpm, PositionPlacement UnderMouse, InitialMapCommand Move keep w-8
Style "Sysinfo" Icon NsCDE/Dtsysinfo.l.pm, MiniIcon NsCDE/Dtsysinfo.t.pm, PositionPlacement Center
Style "Occupy" Icon NsCDE/Occupy.l.xpm, MiniIcon NsCDE/Occupy.t.pm, PositionPlacement UnderMouse
Style "GeometryMgr" Icon NsCDE/GeometryMgr.l.xpm, MiniIcon NsCDE/GeometryMgr.t.xpm, PositionPlacement UnderMouse
Style "WsPgMgr" Icon NsCDE/DtWsm.l.pm, MiniIcon NsCDE/DtWsm.t.pm, PositionPlacement UnderMouse, InitialMapCommand Move keep w-8
Style "NProcMgr" Icon NsCDE/DtProcMgr.l.xpm, MiniIcon NsCDE/DtProcMgr.t.xpm, PositionPlacement UnderMouse, Button 4, InitialMapCommand Move keep w-2
# 3. Pagers
Style "GWMPager" Handles, NoTitle, Sticky, BorderColorset 2, Colorset 2, BorderWidth 3, StaysPut, HilightBorderColorset 2, MiniIcon NsCDE/GWM.t.xpm, PositionPlacement UnderMouse
Style "GWM" Sticky, Button 4, Icon NsCDE/GWM.l.xpm, MiniIcon NsCDE/GWM.t.xpm, PositionPlacement UnderMouse
Style "GWMOptions" Icon NsCDE/GWM.l.xpm, MiniIcon NsCDE/GWM.t.xpm, PositionPlacement UnderMouse
Style "LocalPager" Sticky, Handles, NoTitle, NoIcon, !Iconifiable, Colorset 2, BorderWidth 3, StaysPut, BorderColorset 2, HilightBorderColorset 2, PositionPlacement UnderMouse
Style "WspLocPager" Sticky, Handles, NoTitle, NoIcon, Colorset 2, BorderWidth 3, StaysPut, BorderColorset 2, HilightBorderColorset 2
# 4. Dialogs and fake transients
Style "WaitNotice" WindowListSkip, NoTitle, NoHandles, !Iconifiable, BorderWidth 0, NoIcon, Sticky, PositionPlacement Center, StaysOnTop
Style "NsCDE-Notifier*" FPGrabFocus, PositionPlacement Center, StaysOnTop, !Iconifiable
Style "InputForm*" FPGrabFocus, PositionPlacement Center, !Iconifiable, StaysOnTop, InitialMapCommand WarpToWindow 50 44
Style "ActionForm*" FPGrabFocus, PositionPlacement Center, !Iconifiable, StaysOnTop, InitialMapCommand WarpToWindow 50 44
Style "ChoiceForm*" FPGrabFocus, PositionPlacement Center, !Iconifiable, StaysOnTop, InitialMapCommand WarpToWindow 50 44
Style "NsCDE-Splash" NoTitle, NoHandles, BorderWidth 0, Sticky, StaysOnTop, StartsOnScreen g, !Iconifiable, InitialMapCommand Raise
Style "ColorIntegrationDialog" PositionPlacement UnderMouse, Icon NsCDE/DtColor.l.pm, MiniIcon NsCDE/DtColor.t.pm
Style "FontIntegrationDialog" PositionPlacement UnderMouse, Icon NsCDE/DtFont.l.pm, MiniIcon NsCDE/DtFont.t.pm
Style "NColorsDialog" PositionPlacement UnderMouse, Icon NsCDE/DtColor.l.pm, MiniIcon NsCDE/DtColor.t.pm
Style "ModifyColor" Icon NsCDE/DtColor.l.pm, MiniIcon NsCDE/DtColor.t.pm, PositionPlacement UnderMouse
Style "PaletteDialog" PositionPlacement UnderMouse, Icon NsCDE/DtBkdrp.l.pm, MiniIcon NsCDE/DtBkdrp.t.pm
Style "FilePicker" PositionPlacement UnderMouse, !Iconifiable
Style "$[gt.Restart NsCDE]" NoTitle, NoHandles, Sticky, FPGrabFocus, !Iconifiable, PositionPlacement Center, StaysOnTop
Style "$[gt.User Input Required]" FPGrabFocus, FPFocusByFunctionWarpPointer, !Iconifiable, PositionPlacement UnderMouse
Style "$[gt.User Action Required]" FPGrabFocus, FPFocusByFunctionWarpPointer, !Iconifiable, PositionPlacement Center

# Move away applets before swallowing in FvwmButtons
Style "MonthDayApplet" PositionPlacement +30000p +30000p
Style "CheckMailApplet" PositionPlacement +30000p +30000p
Style "FpLite" PositionPlacement +30000p +30000p
Style "PClock" PositionPlacement +30000p +30000p

# FrontPanel has very complex set of style changes from default.
# By default it has ClickToFocus focus policy, which is masked to
# MouseFocus visually by f_EnterWindow and f_LeaveWindow FvwmEvent(1)
# hooks. This setup provides ability to move across pages on up and
# down edges, without reseting focused state on newly entered page
# because of mouse hover of FrontPanel.
# FrontPanel is iconified right down by default.
Style FrontPanel NoTitle, Sticky, Icon NsCDE/DtWsSwitch.l.xpm, \
 MiniIcon NsCDE/DtWsSwitch.t.xpm, StaysPut, \
 CirculateSkip, NoHandles, BorderWidth 4, \
 IconBox screen c 1 1 -92 -4, IconFill bottom right, \
 WindowShadeSteps 1p, WindowShadeBusy, WindowListSkip, \
 ClickToFocus, UseDecor FpDecor, StartsOnScreen p, \
 InitialMapCommand Move $[infostore.frontpanel.pos.placement], \
 MaxWindowSize 100 136p, EWMHPlacementIgnoreWorkingArea, \
 PositionPlacement $[infostore.frontpanel.pos.placement]

# Subpanels of FrontPanel. UseDecor handles visual appereance of the titlebars
# of subpanels to match thickness of the CDE - this breaks slightly when if/when
# titlebar font is unusually huge.
Style NsCDE-Subpanel* NoHandles, Sticky, Colorset 1, UseDecor SubpanelsDecor, \
 BorderWidth 0, !StickyStippledTitle, Font "$[infostore.font.variable.normal.medium]", \
 WindowListSkip, !Maximizable, MinWindowSize 120p 12p, Icon NsCDE/DtWsSwitch.l.xpm

# For top screen based Front Panel
Test (EnvMatch infostore.frontpanel.on.top 1) Style NsCDE-Subpanel* TitleAtBottom

############################
# Application styles (basic)
############################
Style XTerm IconOverride, Icon NsCDE/Fpterm.l.pm, MiniIcon NsCDE/Fpterm.s.pm, FPOverrideGrabFocus
Style URxvt IconOverride, Icon NsCDE/Fpterm.l.pm, MiniIcon NsCDE/Fpterm.s.pm
Style x-terminal-emulator IconOverride, Icon NsCDE/Fpterm.l.pm, MiniIcon NsCDE/Fpterm.s.pm
Style PClock NoTitle, NoHandles, !Borders, NoIcon
Style xscreensaver-demo Icon NsCDE/DtScrn.l.pm, MiniIcon NsCDE/DtScrn.t.pm
Style gkrellm Sticky, WindowListSkip, NoTitle
Style xeyes NoTitle, NoHandles, ClickToFocus, WindowListSkip
Style xcalc IconOverride, Icon NsCDE/Dtcalc.l.pm, MiniIcon NsCDE/Dtcalc.t.pm
Style xedit IconOverride, Icon NsCDE/Fppenpd.l.pm, MiniIcon NsCDE/Fppenpd.t.pm
Style oclock NoTitle, NoHandles
Style Gimp IconifyWindowGroups
Style "GIMP Startup" NoTitle, NoHandles, !Borders
Style Gkrellm Sticky, WindowListSkip, NoTitle, ClickToFocus, CirculateSkip, PositionPlacement $[infostore.gkrellm.pos.placement]
Style Gkrellm_conf Slippery, WindowListHit, Title, CirculateHit
Style Pidgin IconifyWindowGroups
Style WatchWinMgrErrors Icon NsCDE/DtErrors.l.pm, MiniIcon NsCDE/DtErrors.t.pm
Style FvwmConsole Handles, Button 2, Button 4, Icon NsCDE/FvwmCons.l.xpm, MiniIcon NsCDE/FvwmCons.t.xpm
Style stalonetray NoHandles, BorderWidth 4, StaysOnBottom, MoveByProgramMethod IgnoreGravity, \
 PositionPlacement screen p $[infostore.stalonetray.pos.placement], \
 InitialMapCommand Move screen p $[infostore.stalonetray.pos.placement]

#############
# Menu Styles
#############
MenuStyle * Mwm, BorderWidth 1, Hilight3DThickness -1, PopupDelayed, PopupDelay 0, \
            HilightBack, PopupOffset -3 100, SeparatorsLong, TitleUnderlines2, \
            MenuColorset 1, ActiveColorset 1, GreyedColorset 5, TitleColorset 1, \
            PopupActiveArea 100, Font "$[infostore.font.variable.normal.medium]", \
            ItemFormat "%4.4i%2.16l%4.16l%.2r%-6.4>", \
            DoubleClickTime $[infostore.menudclicktm]

CopyMenuStyle * WorkspaceMenu
CopyMenuStyle * MainSmallMenu
CopyMenuStyle * SmallMenu
CopyMenuStyle * CommonMenu
CopyMenuStyle * CommonAppMenu
CopyMenuStyle * PGMAppMenu
CopyMenuStyle * XDGAppMenu
CopyMenuStyle * WindowList

MenuStyle WorkspaceMenu ActiveColorset 4, TitleUnderlines0, ItemFormat "%4.4l%6.6l%6.4r%Space%-6.4>"
MenuStyle MainSmallMenu Font "$[infostore.font.variable.normal.small]", ActiveColorset 4
MenuStyle SmallMenu Font "$[infostore.font.variable.normal.small]"
MenuStyle CommonMenu ActiveColorset 4
MenuStyle CommonAppMenu TitleUnderlines2, MenuColorset 22, ActiveColorset 6
MenuStyle PGMAppMenu TitleUnderlines2, VerticalItemSpacing 2 4, MenuColorset 22, ActiveColorset 6
MenuStyle XDGAppMenu VerticalItemSpacing 2 3
MenuStyle WindowList VerticalItemSpacing 2 3, ActiveColorset 4, \
 Font "$[infostore.font.variable.normal.$[infostore.windowlist.fontsize]]", \
 TitleFont "$[infostore.font.variable.bold.$[infostore.windowlist.title.fontsize]]"

#####################
# Pointer Icon Styles
#####################
CursorStyle ROOT left_ptr
CursorStyle DEFAULT left_ptr
CursorStyle TITLE left_ptr
CursorStyle SYS arrow
CursorStyle MENU arrow
CursorStyle WAIT cursors/WaitCursor.xpm

####################################
# Custom decor for Subpanel Titlebar
####################################
DestroyDecor SubpanelsDecor
AddToDecor SubpanelsDecor
+ TitleStyle Centered MinHeight 20
+ TitleStyle Active AdjustedPixmap NsCDE/SubpanelTitleActive.xpm
+ TitleStyle Inactive AdjustedPixmap NsCDE/SubpanelTitleInactive.xpm
+ ButtonStyle All --  UseTitleStyle

##################################################
# Custom decor for Front Panel border to match CDE
##################################################
DestroyDecor FpDecor
AddToDecor FpDecor
+ BorderStyle Inactive -- NoInset
+ BorderStyle Active -- NoInset

##############################
# GeometryWindow Style (FVWM3)
##############################
Test (EnvMatch FVWM_IS_FVWM3 1) GeometryWindow Colorset 2

