Skip to content

Commit

Permalink
Fix display of sync destination if it is a longer hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
vslavik committed Dec 11, 2023
1 parent a83de5e commit c7f1f6d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/cloud_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class CloudSyncDestination
public:
virtual ~CloudSyncDestination() {}

/// Name of the destination (e.g. Crowding or hostname)
/// Name of the destination (e.g. Crowdin or hostname)
virtual wxString GetName() const = 0;

/// Asynchronously uploads the file. Returned future throws on error.
Expand Down Expand Up @@ -102,7 +102,7 @@ class CloudSyncProgressWindow : public wxDialog
sizer->SetMinSize(PX(300), -1);
Activity = new ActivityIndicator(this);
sizer->AddStretchSpacer();
sizer->Add(Activity, wxSizerFlags().Expand().Border(wxALL, PX(25)));
sizer->Add(Activity, wxSizerFlags().Expand().Border(wxALL, PX(40)));
sizer->AddStretchSpacer();
SetSizerAndFit(sizer);
CenterOnParent();
Expand All @@ -112,7 +112,15 @@ class CloudSyncProgressWindow : public wxDialog
: CloudSyncProgressWindow(parent)
{
// TRANSLATORS: %s is a cloud destination, e.g. "Crowdin" or ftp.wordpress.com etc.
Activity->Start(wxString::Format(_(L"Uploading translations to %s…"), dest->GetName()));
auto label = wxString::Format(_(L"Uploading translations to %s…"), dest->GetName());

auto sz = Activity->GetTextExtent(label);
Activity->SetSize(wxSize(std::max(PX(300), PX(100) + sz.x), -1));

Activity->Start(label);

GetSizer()->SetSizeHints(this);
CenterOnParent();
}

ActivityIndicator *Activity;
Expand Down
1 change: 1 addition & 0 deletions src/customcontrols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ ActivityIndicator::ActivityIndicator(wxWindow *parent, int flags)
m_spinner->SetWindowVariant(wxWINDOW_VARIANT_SMALL);
m_label = new wxStaticText(this, wxID_ANY, "");
#ifdef __WXOSX__
SetWindowVariant(wxWINDOW_VARIANT_SMALL);
m_label->SetWindowVariant(wxWINDOW_VARIANT_SMALL);
#endif

Expand Down

0 comments on commit c7f1f6d

Please sign in to comment.