Small fix for cancel button text on Linux

This commit is contained in:
tamasmeszaros 2019-03-20 11:12:37 +01:00
parent 4ceba39d99
commit 2f244895d2

View file

@ -5,8 +5,11 @@
#include <wx/button.h> #include <wx/button.h>
#include <wx/statusbr.h> #include <wx/statusbr.h>
#include <wx/frame.h> #include <wx/frame.h>
#include "GUI_App.hpp" #include "GUI_App.hpp"
#include "I18N.hpp"
#include <iostream> #include <iostream>
namespace Slic3r { namespace Slic3r {
@ -22,7 +25,7 @@ ProgressStatusBar::ProgressStatusBar(wxWindow *parent, int id):
wxDefaultSize)), wxDefaultSize)),
m_cancelbutton(new wxButton(self, m_cancelbutton(new wxButton(self,
-1, -1,
"Cancel", _(L("Cancel")),
wxDefaultPosition, wxDefaultPosition,
wxDefaultSize)) wxDefaultSize))
{ {
@ -33,6 +36,9 @@ ProgressStatusBar::ProgressStatusBar(wxWindow *parent, int id):
int w[] = {-1, 150, 155}; int w[] = {-1, 150, 155};
self->SetStatusWidths(3, w); self->SetStatusWidths(3, w);
wxSize s = m_cancelbutton->GetTextExtent(m_cancelbutton->GetLabel());
self->SetMinHeight(int(2 * self->GetBorderY() + 1.2 * s.GetHeight()));
self->Bind(wxEVT_TIMER, [this](const wxTimerEvent&) { self->Bind(wxEVT_TIMER, [this](const wxTimerEvent&) {
if (m_prog->IsShown()) m_timer->Stop(); if (m_prog->IsShown()) m_timer->Stop();
if(is_busy()) m_prog->Pulse(); if(is_busy()) m_prog->Pulse();