← Back to team overview

kicad-developers team mailing list archive

Message Dialogs

 

There has been a brief discussion in this bug (
https://bugs.launchpad.net/kicad/+bug/1836498) about removing the bold text
from the save dialogs, and instead having all the text as normal font. Part
of this is because wxWidgets has an annoying bug with sizing bold text on
GTK, and the other part is it does seem to look better without the bold
text (see the proposed save dialog attached for how it looks on GTK).

I am also thinking that unifying some of the dialogs to use
wxRichMessageDialog instead of wxMessageDialog would be useful. For the
save changes dialog, the Mac builds already always use wxRichMessageDialog
for every dialog, while Linux and Windows use both wxRichMessageDialog and
wxMessageDialog depending on the application. The rich message version
appears cleaner on GTK (see attached) than the normal message version
(which also isn't showing the icon on Linux it seems).

I also think it might be good to discuss doing this to the other dialogs to
try to unify their look across the board. An example for making this change
to the revert dialog is attached. This converts it from the normal message
dialog to a rich message dialog. (There are probably many others we could
look at as well, but these are just the two I played with currently).

I have attached a sample patch that changes these dialogs so people can try
it (do not commit this, it is a test only and can be made much cleaner if
we actually want to use it). I would like to get feedback from people, and
also find out how this looks on Windows (Jeff already says it looks better
on Mac).

Thoughts?

-Ian

Attachment: ProposedRevertDialog.png
Description: PNG image

Attachment: ProposedSaveDialog.png
Description: PNG image

From a19ff61c49a669872679f6f8199ff354295c440d Mon Sep 17 00:00:00 2001
From: Ian McInerney <Ian.S.McInerney@xxxxxxxx>
Date: Sat, 20 Jul 2019 11:08:21 +0200
Subject: [PATCH] TEST: Test save dialog formatting

---
 common/confirm.cpp | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/common/confirm.cpp b/common/confirm.cpp
index fbb038b4d..eb109315e 100644
--- a/common/confirm.cpp
+++ b/common/confirm.cpp
@@ -156,9 +156,12 @@ int UnsavedChangesDialog( wxWindow* parent, wxString aMessage, bool* aApplyToAll
 {
     static bool s_apply_to_all = false;
 
-    wxRichMessageDialog dlg( parent, aMessage, wxEmptyString,
+    wxString msg;
+    msg << aMessage << "\n\n" << _( "If you don't save, all your changes will be permanently lost." );
+
+    wxRichMessageDialog dlg( parent, msg, _( "Save Changes?" ),
                              wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_WARNING | wxCENTER );
-    dlg.SetExtendedMessage( _( "If you don't save, all your changes will be permanently lost." ) );
+    //dlg.SetExtendedMessage( _( "If you don't save, all your changes will be permanently lost." ) );
     dlg.SetYesNoLabels( _( "Save" ), _( "Discard Changes" ) );
 
     if( aApplyToAll )
@@ -179,10 +182,10 @@ int UnsavedChangesDialog( wxWindow* parent, wxString aMessage, bool* aApplyToAll
 
 int UnsavedChangesDialog( wxWindow* parent, const wxString& aMessage )
 {
-#ifdef __APPLE__
+//#ifdef __APPLE__
     // wxWidgets gets the button order wrong on Mac so use the other dialog.
     return UnsavedChangesDialog( parent, aMessage, nullptr );
-#else
+//#else
     wxMessageDialog dlg( parent, aMessage, wxEmptyString,
                          wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_WARNING | wxCENTER );
     dlg.SetExtendedMessage( _( "If you don't save, all your changes will be permanently lost." ) );
@@ -190,15 +193,18 @@ int UnsavedChangesDialog( wxWindow* parent, const wxString& aMessage )
 
     // Returns wxID_YES, wxID_NO, or wxID_CANCEL
     return dlg.ShowModal();
-#endif
+//#endif
 }
 
 
 bool ConfirmRevertDialog( wxWindow* parent, const wxString& aMessage )
 {
-    wxMessageDialog dlg( parent, aMessage, wxEmptyString,
+    wxString msg;
+    msg << aMessage << "\n\n" << _( "Your current changes will be permanently lost." );
+
+    wxRichMessageDialog dlg( parent, msg, _( "Revert Changes?" ),
                          wxOK | wxCANCEL | wxOK_DEFAULT | wxICON_WARNING | wxCENTER );
-    dlg.SetExtendedMessage( _( "Your current changes will be permanently lost." ) );
+//    dlg.SetExtendedMessage( _( "Your current changes will be permanently lost." ) );
     dlg.SetOKCancelLabels( _( "Revert" ), _( "Cancel" ) );
 
     return dlg.ShowModal() == wxID_OK;
-- 
2.21.0

Attachment: CurrentRevertDialog.png
Description: PNG image

Attachment: CurrentSaveDialog.png
Description: PNG image


Follow ups