[taffybar] Update CSS for workspace auto size image

This commit is contained in:
Ivan Malison 2018-05-18 01:20:15 -07:00
parent 4d9ea9acbe
commit 8d8120fbda
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
2 changed files with 25 additions and 33 deletions

View File

@ -4,40 +4,26 @@
@define-color urgent-window-color #D9CB9E; @define-color urgent-window-color #D9CB9E;
@define-color font-color #FFFFFF; @define-color font-color #FFFFFF;
.Contents {
padding-bottom: 2px;
padding-top: 2px;
padding-right: 2px;
padding-left: 2px;
transition: border-color .5s, background-color .5s;
border-radius: 5px;
border-style: solid;
border-width: 1px;
border-color: rgba(1.0, 1.0, 1.0, 0.0);
}
.Active .Contents, .Visible .Contents {
background-color: rgba(0.0, 0.0, 0.0, 0.5);
}
.Contents {
padding: 5px;
}
.InnerPad { .InnerPad {
padding-bottom: 12px;
padding-top: 12px;
padding-left: 4px;
padding-right: 4px;
}
.Workspaces .InnerPad {
padding-bottom: 5px; padding-bottom: 5px;
padding-top: 5px; padding-top: 5px;
padding-left: 2px; padding-left: 2px;
padding-right: 2px; padding-right: 2px;
} }
.Contents {
padding-bottom: 4px;
padding-top: 4px;
padding-right: 2px;
padding-left: 2px;
transition: background-color .5s;
border-radius: 5px;
}
.Active .Contents, .Visible .Contents {
background-color: rgba(0.0, 0.0, 0.0, 0.5);
}
.WorkspaceLabel { .WorkspaceLabel {
padding-right: 3px; padding-right: 3px;
padding-left: 2px; padding-left: 2px;
@ -98,6 +84,8 @@
.IconImage { .IconImage {
transition: opacity .5s, background-color .5s; transition: opacity .5s, background-color .5s;
opacity: 1; opacity: 1;
padding-bottom: 1px;
padding-top: 1px;
} }
.IconContainer { .IconContainer {
@ -112,7 +100,7 @@
/* background-color: rgba(255, 255, 255, 0.3); */ /* background-color: rgba(255, 255, 255, 0.3); */
border-radius: 0px; border-radius: 0px;
opacity: 1; opacity: 1;
box-shadow: inset 0 -2px #FFFFFF; box-shadow: inset 0 -1px #FFFFFF;
} }
.IconContainer.Urgent { .IconContainer.Urgent {

View File

@ -53,6 +53,13 @@ import Text.Printf
import Text.Read hiding (lift) import Text.Read hiding (lift)
import Unsafe.Coerce import Unsafe.Coerce
buildContentsBox widget = liftIO $ do
contents <- Gtk.hBoxNew False 0
Gtk.containerAdd contents widget
_ <- widgetSetClass contents "Contents"
Gtk.widgetShowAll contents
buildPadBox contents
setMinWidth width widget = liftIO $ do setMinWidth width widget = liftIO $ do
Gtk.widgetSetSizeRequest widget width (-1) Gtk.widgetSetSizeRequest widget width (-1)
return widget return widget
@ -157,11 +164,8 @@ main = do
workspaces = workspacesNew myWorkspacesConfig workspaces = workspacesNew myWorkspacesConfig
baseConfig = defaultSimpleTaffyConfig baseConfig = defaultSimpleTaffyConfig
{ startWidgets = { startWidgets =
[ flip widgetSetClass "Workspaces" =<< workspaces workspaces : map (>>= buildContentsBox) [ layout, windows ]
, layout >>= buildPadBox , endWidgets = map (>>= buildContentsBox)
, windows >>= buildPadBox
]
, endWidgets = map (>>= buildPadBox)
[ textClockNew Nothing "%a %b %_d %r" 1 [ textClockNew Nothing "%a %b %_d %r" 1
, textBatteryNew "$percentage$% ($time$)" , textBatteryNew "$percentage$% ($time$)"
, batteryIconNew , batteryIconNew