summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-03-12 19:39:30 +0100
committerCarl Hetherington <cth@carlh.net>2025-03-12 19:39:30 +0100
commit063e5c06999f1952c06ea4c44c0c2470db164005 (patch)
treeecf63a555f24aa6d693cb0aa6749c78eebfa2268
parent62683769d4e3b081205d04dc06afecbc0828b4d4 (diff)
Make file and dir picker look more consistent with each other.
-rw-r--r--src/wx/dir_picker_ctrl.cc14
-rw-r--r--src/wx/dir_picker_ctrl.h6
-rw-r--r--src/wx/file_picker_ctrl.cc4
3 files changed, 12 insertions, 12 deletions
diff --git a/src/wx/dir_picker_ctrl.cc b/src/wx/dir_picker_ctrl.cc
index 034ae5a5e..8f2830a6d 100644
--- a/src/wx/dir_picker_ctrl.cc
+++ b/src/wx/dir_picker_ctrl.cc
@@ -42,17 +42,15 @@ DirPickerCtrl::DirPickerCtrl(wxWindow* parent, bool leaf)
{
_sizer = new wxBoxSizer (wxHORIZONTAL);
- _folder = new StaticText(this, {}, wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
- wxFont font = _folder->GetFont ();
- font.SetStyle (wxFONTSTYLE_ITALIC);
- _folder->SetFont (font);
- _sizer->Add (_folder, 1, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP);
- _browse = new Button (this, _("Browse..."));
- _sizer->Add (_browse, 0);
+ wxClientDC dc(parent);
+ auto size = dc.GetTextExtent(char_to_wx("This is the length of the file label it should be quite long"));
+ size.SetHeight(-1);
+ _folder = new Button(this, _("Browse..."), wxDefaultPosition, size, wxBU_LEFT);
+ _sizer->Add(_folder, 1, wxEXPAND, 0);
SetSizer (_sizer);
- _browse->Bind (wxEVT_BUTTON, boost::bind (&DirPickerCtrl::browse_clicked, this));
+ _folder->Bind(wxEVT_BUTTON, boost::bind(&DirPickerCtrl::browse_clicked, this));
}
void
diff --git a/src/wx/dir_picker_ctrl.h b/src/wx/dir_picker_ctrl.h
index 31df9518c..f28623a7c 100644
--- a/src/wx/dir_picker_ctrl.h
+++ b/src/wx/dir_picker_ctrl.h
@@ -30,6 +30,9 @@ LIBDCP_ENABLE_WARNINGS
#include <boost/signals2.hpp>
+class Button;
+
+
class DirPickerCtrl : public wxPanel
{
public:
@@ -43,8 +46,7 @@ public:
private:
void browse_clicked ();
- wxStaticText* _folder;
- wxButton* _browse;
+ Button* _folder;
wxString _path;
wxSizer* _sizer;
bool _leaf = false;
diff --git a/src/wx/file_picker_ctrl.cc b/src/wx/file_picker_ctrl.cc
index 3511a4497..90f07da59 100644
--- a/src/wx/file_picker_ctrl.cc
+++ b/src/wx/file_picker_ctrl.cc
@@ -61,7 +61,7 @@ FilePickerCtrl::FilePickerCtrl(
wxSize size = dc.GetTextExtent(char_to_wx("This is the length of the file label it should be quite long"));
size.SetHeight (-1);
- _file = new Button (this, _("(None)"), wxDefaultPosition, size, wxBU_LEFT);
+ _file = new Button(this, _("Browse..."), wxDefaultPosition, size, wxBU_LEFT);
_sizer->Add (_file, 1, wxEXPAND, 0);
SetSizerAndFit (_sizer);
@@ -77,7 +77,7 @@ FilePickerCtrl::set_filename(boost::optional<string> filename)
if (filename) {
_file->SetLabel(std_to_wx(*filename));
} else {
- _file->SetLabel(_("None"));
+ _file->SetLabel(_("Browse..."));
}
}