From 264e04555b6dc278b3bd0e3a8d4d7c32bb9af480 Mon Sep 17 00:00:00 2001 From: sheaf Date: Sat, 28 Sep 2024 00:38:32 +0200 Subject: [PATCH] add header to warning dialog --- assets/theme.css | 6 +++++- src/app/MetaBrush/Application/Action.hs | 10 +++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/assets/theme.css b/assets/theme.css index 37eba06..1757f9b 100644 --- a/assets/theme.css +++ b/assets/theme.css @@ -5,11 +5,15 @@ } */ -.toggle, .dialogButton, .titleBar, .windowIcon, .fileBarCloseButton, +.toggle, .dialogButton, .titlebar, .titleBar, .windowIcon, .fileBarCloseButton, .newFileButton, .header, .paned, .panel, .tabs, .frame { all: unset; } +windowcontrols { + all: unset; +} + .reorderable-page { all: unset; } diff --git a/src/app/MetaBrush/Application/Action.hs b/src/app/MetaBrush/Application/Action.hs index dd01901..206e041 100644 --- a/src/app/MetaBrush/Application/Action.hs +++ b/src/app/MetaBrush/Application/Action.hs @@ -426,7 +426,11 @@ instance HandleAction Close where | unsavedChanges documentContent -> do dialogWindow <- GTK.windowNew - GTK.setWindowDecorated dialogWindow False + + -- Show a header, but not a "X" close button. + GTK.setWindowDecorated dialogWindow True + GTK.windowSetDeletable dialogWindow False + GTK.windowSetTitle dialogWindow ( Just "Warning" ) GTK.windowSetTransientFor dialogWindow ( Just window ) contentBox <- GTK.boxNew GTK.OrientationVertical 30 @@ -453,8 +457,8 @@ instance HandleAction Close where GTK.buttonSetLabel cancelButton "Cancel" GTK.boxAppend buttonBox cancelButton - widgetAddClasses dialogWindow ["metabrush", "bg", "plain", "text", "dialog"] - for_ [closeButton, saveCloseButton, cancelButton] \ button -> + widgetAddClasses dialogWindow [ "metabrush", "bg", "plain", "text", "dialog" ] + for_ [ closeButton, saveCloseButton, cancelButton ] \ button -> widgetAddClass button "dialogButton" void $ GTK.onButtonClicked closeButton $ do