Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure the New macro dialog is large enough #915

Merged
merged 2 commits into from
Mar 22, 2018

Conversation

hroncok
Copy link
Collaborator

@hroncok hroncok commented Mar 20, 2018

Before:

nm1

After:

nm2

@hroncok hroncok added the 2.x Non-breaking features and fixes suitable for inclusion in future Printrun 2.x minor releases label Mar 20, 2018
@hroncok hroncok requested review from kliment and rockstorm101 March 20, 2018 14:24
@rockstorm101
Copy link
Collaborator

I still see the buttons a little too small:

macro_buttons_too_small

The following change works for me and it does not hardcode a size for the whole dialog:

diff --git a/printrun/pronterface.py b/printrun/pronterface.py
index 5731e67..e8a2a65 100644
--- a/printrun/pronterface.py
+++ b/printrun/pronterface.py
@@ -2164,7 +2164,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
         self.update_macros_menu()
 
     def new_macro(self, e = None):
-        dialog = wx.Dialog(self, -1, _("Enter macro name"), size = (260, 100))
+        dialog = wx.Dialog(self, -1, _("Enter macro name"))
         panel = wx.Panel(dialog, -1)
         vbox = wx.BoxSizer(wx.VERTICAL)
         wx.StaticText(panel, -1, _("Macro name:"), (8, 14))
@@ -2176,7 +2176,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
         hbox.Add(wx.Button(dialog, wx.ID_CANCEL, _("Cancel")))
         vbox.Add(panel)
         vbox.Add(hbox, 1, wx.ALIGN_CENTER | wx.TOP | wx.BOTTOM, 10)
-        dialog.SetSizer(vbox)
+        dialog.SetSizerAndFit(vbox)
         dialog.Centre()
         macro = ""
         if dialog.ShowModal() == wx.ID_OK:

@hroncok hroncok force-pushed the new_macro_button_size branch from 0ef3588 to 8780537 Compare March 20, 2018 16:01
@hroncok
Copy link
Collaborator Author

hroncok commented Mar 20, 2018

Rebased.

nm3

@hroncok
Copy link
Collaborator Author

hroncok commented Mar 20, 2018

I don't like the input field pushed tot he right border, might need some kind of spacer. My xwPython skills are close to zero, so I have no idea how to solve that.

@rockstorm101
Copy link
Collaborator

Yes, that's not good, I'll look into it.

@rockstorm101
Copy link
Collaborator

@kliment , @siorai could you please check if the new macro dialog looks good on Windows and Mac now?

@kliment
Copy link
Owner

kliment commented Mar 22, 2018

Looks fine on windows, I can't check mac now but I think it's fine to merge.

@kliment kliment merged commit a9d5639 into kliment:2.x Mar 22, 2018
@hroncok hroncok deleted the new_macro_button_size branch March 22, 2018 22:54
@hroncok
Copy link
Collaborator Author

hroncok commented Mar 22, 2018

pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Non-breaking features and fixes suitable for inclusion in future Printrun 2.x minor releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants