From 6155f2902bd828999f6c59dbe8ba41d78bd45f4e Mon Sep 17 00:00:00 2001 From: hashirama Date: Thu, 20 Mar 2025 03:53:36 +0000 Subject: [PATCH] Update scrollableDictionaryIconBar.hs --- scrollableDictionaryIconBar.hs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scrollableDictionaryIconBar.hs b/scrollableDictionaryIconBar.hs index 697d41f..844c113 100644 --- a/scrollableDictionaryIconBar.hs +++ b/scrollableDictionaryIconBar.hs @@ -36,12 +36,32 @@ createIconToolbar' iconPaths = do toolbar <- Gtk.boxNew Gtk.OrientationHorizontal 0 Gtk.widgetSetHalign toolbar Gtk.AlignCenter Gtk.widgetSetValign toolbar Gtk.AlignCenter + + cssProvider <- Gtk.cssProviderNew + Gtk.cssProviderLoadFromString cssProvider $ T.pack $ + ".classic-button {" + ++ " -gtk-appearance: none;" + ++ " background-image: linear-gradient(to bottom, #f3f3f3, #d8d8d8);" + ++ " border: 1px solid #bbb;" + ++ " border-radius: 4px;" + ++ " color: #333;" + ++ " box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);" + ++ " padding: 4px 8px;" + ++ "}" + ++ ".classic-button:hover {" + ++ " background-image: linear-gradient(to bottom, #e6e6e6, #ccc);" + ++ "}" + ++ ".classic-button:active {" + ++ " background-image: linear-gradient(to bottom, #ccc, #e6e6e6);" + ++ "}" + mapM_ (\path -> do icon <- Gtk.imageNewFromFile path Gtk.widgetSetSizeRequest icon 64 64 -- Force minimum size btn <- Gtk.buttonNew + Gtk.widgetAddCssClass btn "glass-button" Gtk.widgetSetSizeRequest btn 80 80 -- Button size (icon + padding) Gtk.widgetSetHalign btn Gtk.AlignCenter Gtk.widgetSetValign btn Gtk.AlignCenter