Previous behavior for Profile Panel's combobox size restored
See issue #3300 and #3446.
This commit is contained in:
@@ -49,7 +49,7 @@ private:
|
||||
private:
|
||||
void prepareProfileBox ()
|
||||
{
|
||||
profileBox.set_size_request(90, -1);
|
||||
profileBox.setPreferredWidth(70, 200);
|
||||
setExpandAlignProperties (&profileBox, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL);
|
||||
|
||||
profileBox.append (M ("PREFERENCES_PROFILE_NONE"));
|
||||
|
@@ -938,6 +938,7 @@ void MyScrolledWindow::get_preferred_height_for_width_vfunc (int width, int &min
|
||||
|
||||
MyComboBoxText::MyComboBoxText (bool has_entry) : Gtk::ComboBoxText(has_entry)
|
||||
{
|
||||
minimumWidth = naturalWidth = 70;
|
||||
Gtk::CellRendererText* cellRenderer = dynamic_cast<Gtk::CellRendererText*>(get_first_cell());
|
||||
cellRenderer->property_ellipsize() = Pango::ELLIPSIZE_MIDDLE;
|
||||
}
|
||||
@@ -955,6 +956,39 @@ bool MyComboBoxText::on_scroll_event (GdkEventScroll* event)
|
||||
return false;
|
||||
}
|
||||
|
||||
void MyComboBoxText::setPreferredWidth (int minimum_width, int natural_width)
|
||||
{
|
||||
if (natural_width == -1 && minimum_width == -1) {
|
||||
naturalWidth = minimumWidth = 70;
|
||||
} else if (natural_width == -1) {
|
||||
naturalWidth = minimumWidth = minimum_width;
|
||||
} else if (minimum_width == -1) {
|
||||
naturalWidth = natural_width;
|
||||
minimumWidth = rtengine::max(naturalWidth / 2, 20);
|
||||
minimumWidth = rtengine::min(naturalWidth, minimumWidth);
|
||||
} else {
|
||||
naturalWidth = natural_width;
|
||||
minimumWidth = minimum_width;
|
||||
}
|
||||
}
|
||||
|
||||
void MyComboBoxText::get_preferred_width_vfunc (int &minimum_width, int &natural_width) const
|
||||
{
|
||||
natural_width = rtengine::max(naturalWidth, 10);
|
||||
minimum_width = rtengine::max(minimumWidth, 10);
|
||||
}
|
||||
void MyComboBoxText::get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const
|
||||
{
|
||||
natural_width = rtengine::max(naturalWidth, 10);
|
||||
minimum_width = rtengine::max(minimumWidth, 10);
|
||||
}
|
||||
|
||||
|
||||
MyComboBox::MyComboBox ()
|
||||
{
|
||||
minimumWidth = naturalWidth = 70;
|
||||
}
|
||||
|
||||
bool MyComboBox::on_scroll_event (GdkEventScroll* event)
|
||||
{
|
||||
|
||||
@@ -968,6 +1002,33 @@ bool MyComboBox::on_scroll_event (GdkEventScroll* event)
|
||||
return false;
|
||||
}
|
||||
|
||||
void MyComboBox::setPreferredWidth (int minimum_width, int natural_width)
|
||||
{
|
||||
if (natural_width == -1 && minimum_width == -1) {
|
||||
naturalWidth = minimumWidth = 70;
|
||||
} else if (natural_width == -1) {
|
||||
naturalWidth = minimumWidth = minimum_width;
|
||||
} else if (minimum_width == -1) {
|
||||
naturalWidth = natural_width;
|
||||
minimumWidth = rtengine::max(naturalWidth / 2, 20);
|
||||
minimumWidth = rtengine::min(naturalWidth, minimumWidth);
|
||||
} else {
|
||||
naturalWidth = natural_width;
|
||||
minimumWidth = minimum_width;
|
||||
}
|
||||
}
|
||||
|
||||
void MyComboBox::get_preferred_width_vfunc (int &minimum_width, int &natural_width) const
|
||||
{
|
||||
natural_width = rtengine::max(naturalWidth, 10);
|
||||
minimum_width = rtengine::max(minimumWidth, 10);
|
||||
}
|
||||
void MyComboBox::get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const
|
||||
{
|
||||
natural_width = rtengine::max(naturalWidth, 10);
|
||||
minimum_width = rtengine::max(minimumWidth, 10);
|
||||
}
|
||||
|
||||
MySpinButton::MySpinButton ()
|
||||
{
|
||||
Gtk::Border border;
|
||||
|
@@ -273,7 +273,16 @@ public:
|
||||
*/
|
||||
class MyComboBox : public Gtk::ComboBox
|
||||
{
|
||||
int naturalWidth, minimumWidth;
|
||||
|
||||
bool on_scroll_event (GdkEventScroll* event);
|
||||
void get_preferred_width_vfunc (int &minimum_width, int &natural_width) const;
|
||||
void get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const;
|
||||
|
||||
public:
|
||||
MyComboBox ();
|
||||
|
||||
void setPreferredWidth (int minimum_width, int natural_width);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -281,10 +290,16 @@ class MyComboBox : public Gtk::ComboBox
|
||||
*/
|
||||
class MyComboBoxText : public Gtk::ComboBoxText
|
||||
{
|
||||
int naturalWidth, minimumWidth;
|
||||
|
||||
bool on_scroll_event (GdkEventScroll* event);
|
||||
void get_preferred_width_vfunc (int &minimum_width, int &natural_width) const;
|
||||
void get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const;
|
||||
|
||||
public:
|
||||
MyComboBoxText (bool has_entry = false);
|
||||
|
||||
void setPreferredWidth (int minimum_width, int natural_width);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -58,7 +58,6 @@ ProfilePanel::ProfilePanel () : storedPProfile(nullptr), lastFilename(""), image
|
||||
// Create the Combobox
|
||||
profiles = Gtk::manage (new ProfileStoreComboBox ());
|
||||
setExpandAlignProperties(profiles, true, true, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
|
||||
profiles->set_size_request(90);
|
||||
|
||||
load = Gtk::manage (new Gtk::Button ());
|
||||
load->add (*Gtk::manage (new RTImage ("gtk-open.png")));
|
||||
|
@@ -516,6 +516,7 @@ ProfileStoreLabel::ProfileStoreLabel(const ProfileStoreEntry *entry) : Gtk::Labe
|
||||
ProfileStoreComboBox::ProfileStoreComboBox ()
|
||||
{
|
||||
updateProfileList();
|
||||
setPreferredWidth(50, 120);
|
||||
Gtk::CellRendererText* cellRenderer = dynamic_cast<Gtk::CellRendererText*>(get_first_cell());
|
||||
cellRenderer->property_ellipsize() = Pango::ELLIPSIZE_MIDDLE;
|
||||
cellRenderer->property_ellipsize_set() = true;
|
||||
|
Reference in New Issue
Block a user