summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-12-08 20:13:09 +0100
committerCarl Hetherington <cth@carlh.net>2020-12-08 20:23:14 +0100
commite06d1831abc6786933db935f298c8a4e8e76e599 (patch)
tree56a7f6b29f6fd774ce1ddedf4629e6156c6591b7 /src
parent942f2c6ae6be33fb17ec46931bbe071a9d2e6f17 (diff)
Shrink some big buttons.
Diffstat (limited to 'src')
-rw-r--r--src/wx/timecode.cc3
-rw-r--r--src/wx/video_panel.cc4
-rw-r--r--src/wx/wx_util.cc13
-rw-r--r--src/wx/wx_util.h1
4 files changed, 17 insertions, 4 deletions
diff --git a/src/wx/timecode.cc b/src/wx/timecode.cc
index 684f29b19..0602358a9 100644
--- a/src/wx/timecode.cc
+++ b/src/wx/timecode.cc
@@ -62,8 +62,9 @@ TimecodeBase::TimecodeBase (wxWindow* parent, bool set_button)
_frames = new wxTextCtrl (_editable, wxID_ANY, wxT(""), wxDefaultPosition, s, 0, validator);
_frames->SetMaxLength (2);
editable_sizer->Add (_frames);
+
if (set_button) {
- _set_button = new Button (_editable, _("Set"));
+ _set_button = new Button (_editable, _("Set"), wxDefaultPosition, small_button_size(parent, _("Set")));
editable_sizer->Add (_set_button, 0, wxLEFT | wxRIGHT, 8);
}
_editable->SetSizerAndFit (editable_sizer);
diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc
index f5e514fab..8841005fa 100644
--- a/src/wx/video_panel.cc
+++ b/src/wx/video_panel.cc
@@ -166,7 +166,7 @@ VideoPanel::VideoPanel (ContentPanel* p)
_scale_label = create_label (this, _("Scale"), true);
_scale_fit = new wxRadioButton (this, wxID_ANY, _("to fit DCP"));
_scale_custom = new wxRadioButton (this, wxID_ANY, _("custom"));
- _scale_custom_edit = new Button (this, _("Edit..."));
+ _scale_custom_edit = new Button (this, _("Edit..."), wxDefaultPosition, small_button_size(this, _("Edit...")));
_colour_conversion_label = create_label (this, _("Colour conversion"), true);
_colour_conversion = new wxChoice (this, wxID_ANY, wxDefaultPosition, size);
@@ -177,7 +177,7 @@ VideoPanel::VideoPanel (ContentPanel* p)
/// TRANSLATORS: translate the word "Custom" here; do not include the "Colour|" prefix
_colour_conversion->Append (S_("Colour|Custom"));
- _edit_colour_conversion_button = new Button (this, _("Edit..."));
+ _edit_colour_conversion_button = new Button (this, _("Edit..."), wxDefaultPosition, small_button_size(this, _("Edit...")));
_range_label = create_label (this, _("Range"), true);
_range = new wxChoice (this, wxID_ANY);
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc
index 758d57a80..7948dd13c 100644
--- a/src/wx/wx_util.cc
+++ b/src/wx/wx_util.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -592,3 +592,14 @@ bitmap_path (string name)
return std_to_wx (p.string());
}
+
+wxSize
+small_button_size (wxWindow* parent, wxString text)
+{
+ wxClientDC dc (parent);
+ wxSize size = dc.GetTextExtent (text);
+ size.SetHeight (-1);
+ size.IncBy (24, 0);
+ return size;
+}
+
diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h
index 0e5397b68..4131ec0f7 100644
--- a/src/wx/wx_util.h
+++ b/src/wx/wx_util.h
@@ -91,6 +91,7 @@ extern double calculate_mark_interval (double start);
extern bool display_progress (wxString title, wxString task);
extern bool report_errors_from_last_job (wxWindow* parent);
extern wxString bitmap_path (std::string name);
+extern wxSize small_button_size (wxWindow* parent, wxString text);
struct Offset
{