From 2fcc5b75c83c6f7ebe9f3347046fc2e5e4b46a36 Mon Sep 17 00:00:00 2001 From: Hombre Date: Wed, 9 Nov 2016 00:09:52 +0100 Subject: [PATCH] Solving issue #3497, #3500, #3498 and #3483 For issue #3483, the old behavior is restored, i.e. the minimum width of the ProfilePanel combobox is the maximum width of its content. Style updated for the Exif and IPTC sub-tabs --- rtdata/themes/RawTherapee.css | 59 ++++++++--- rtgui/batchqueuepanel.cc | 38 ++++--- rtgui/editorpanel.cc | 2 +- rtgui/exifpanel.cc | 10 ++ rtgui/filecatalog.cc | 21 ++-- rtgui/guiutils.cc | 63 +----------- rtgui/guiutils.h | 17 +--- rtgui/iptcpanel.cc | 181 ++++++++++++++++++++++------------ rtgui/iptcpanel.h | 6 +- rtgui/profilepanel.cc | 34 +++---- rtgui/profilepanel.h | 2 +- rtgui/profilestore.cc | 1 + rtgui/rtwindow.cc | 35 +++---- 13 files changed, 235 insertions(+), 234 deletions(-) diff --git a/rtdata/themes/RawTherapee.css b/rtdata/themes/RawTherapee.css index a4c3c44a1..a742b3bbc 100644 --- a/rtdata/themes/RawTherapee.css +++ b/rtdata/themes/RawTherapee.css @@ -41,10 +41,6 @@ padding: 2px; } -.plainback { - background-color: #404040; -} - window > decoration { box-shadow: none; margin: 0px; @@ -606,24 +602,55 @@ paned > separator { /* All tool panels have a frame except for Meta which unlike the rest is a notebook itself. * So we use CSS to make it look like a frame. */ -#MetaPanelNotebook.frame { +#MetaPanelNotebook > stack > box { border: 1px solid #262626; - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - border-top-left-radius: 0; - border-top-right-radius: 0; - border-top-width: 0; + background-color: #363636; + border-radius: 0 0 4px 4px; + border-top-style: none; + padding: 0 3px 3px 3px; + margin: 0 5px 5px 5px; } #MetaPanelNotebook header { border: 1px solid #262626; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom-width: 0; + background-color: #363636; + border-radius: 4px 4px 0 0; + border-bottom-style: none; padding: 5px; - margin: 5px; + margin: 5px 5px 0 5px; +} + +#MetaPanelNotebook > header > tabs { + background-color: #363636; +} + +#MetaPanelNotebook > header tab { + margin: 0 5px; + padding: 5px; +} + +#MetaPanelNotebook textview { + border-radius: 3px; +} + +#MetaPanelNotebook entry, #MetaPanelNotebook scrolledwindow, #MetaPanelNotebook combobox { + margin: 2px 0 2px 0; +} + +#MetaPanelNotebook entry { + padding: 0 1px; +} + +#MetaPanelNotebook label { + padding: 0 5px; +} + +#MetaPanelNotebook text { + border-color: #202020; + background-color: #262626; + border-style: solid; + border-width: 1px; + border-radius: 3px; } #PreviewWindow { diff --git a/rtgui/batchqueuepanel.cc b/rtgui/batchqueuepanel.cc index 73b53874b..66f5341fa 100644 --- a/rtgui/batchqueuepanel.cc +++ b/rtgui/batchqueuepanel.cc @@ -204,50 +204,46 @@ void BatchQueuePanel::updateTab (int qsize, int forceOrientation) qsize = batchQueue->getEntries().size(); } + Gtk::Grid* grid = Gtk::manage (new Gtk::Grid ()); if ((forceOrientation == 0 && options.mainNBVertical) || (forceOrientation == 2)) { - Gtk::VBox* vbb = Gtk::manage (new Gtk::VBox ()); Gtk::Label* l; if(!qsize ) { - vbb->pack_start (*Gtk::manage (new RTImage ("processing.png"))); + grid->attach_next_to(*Gtk::manage (new RTImage ("processing.png")), Gtk::POS_TOP, 1, 1); l = Gtk::manage (new Gtk::Label (Glib::ustring(" ") + M("MAIN_FRAME_BATCHQUEUE")) ); } else if( start->get_active () ) { - vbb->pack_start (*Gtk::manage (new RTImage ("processing-play.png"))); + grid->attach_next_to(*Gtk::manage (new RTImage ("processing-play.png")), Gtk::POS_TOP, 1, 1); l = Gtk::manage (new Gtk::Label (Glib::ustring(" ") + M("MAIN_FRAME_BATCHQUEUE") + " [" + Glib::ustring::format( qsize ) + "]")); } else { - vbb->pack_start (*Gtk::manage (new RTImage ("processing-pause.png"))); + grid->attach_next_to(*Gtk::manage (new RTImage ("processing-pause.png")), Gtk::POS_TOP, 1, 1); l = Gtk::manage (new Gtk::Label (Glib::ustring(" ") + M("MAIN_FRAME_BATCHQUEUE") + " [" + Glib::ustring::format( qsize ) + "]" )); } l->set_angle (90); - vbb->pack_start (*l); - vbb->set_spacing (2); - vbb->set_tooltip_markup (M("MAIN_FRAME_BATCHQUEUE_TOOLTIP")); - vbb->show_all (); + grid->attach_next_to(*l, Gtk::POS_TOP, 1, 1); + grid->set_tooltip_markup (M("MAIN_FRAME_BATCHQUEUE_TOOLTIP")); + grid->show_all (); if (nb) { - nb->set_tab_label(*this, *vbb); + nb->set_tab_label(*this, *grid); } } else { - Gtk::HBox* hbb = Gtk::manage (new Gtk::HBox ()); - if (!qsize ) { - hbb->pack_start (*Gtk::manage (new RTImage ("processing.png"))); - hbb->pack_start (*Gtk::manage (new Gtk::Label (M("MAIN_FRAME_BATCHQUEUE") ))); + grid->attach_next_to(*Gtk::manage (new RTImage ("processing.png")), Gtk::POS_RIGHT, 1, 1); + grid->attach_next_to(*Gtk::manage (new Gtk::Label (M("MAIN_FRAME_BATCHQUEUE") )), Gtk::POS_RIGHT, 1, 1); } else if ( start->get_active () ) { - hbb->pack_start (*Gtk::manage (new RTImage ("processing-play.png"))); - hbb->pack_start (*Gtk::manage (new Gtk::Label (M("MAIN_FRAME_BATCHQUEUE") + " [" + Glib::ustring::format( qsize ) + "]" ))); + grid->attach_next_to(*Gtk::manage (new RTImage ("processing-play.png")), Gtk::POS_RIGHT, 1, 1); + grid->attach_next_to(*Gtk::manage (new Gtk::Label (M("MAIN_FRAME_BATCHQUEUE") + " [" + Glib::ustring::format( qsize ) + "]" )), Gtk::POS_RIGHT, 1, 1); } else { - hbb->pack_start (*Gtk::manage (new RTImage ("processing-pause.png"))); - hbb->pack_start (*Gtk::manage (new Gtk::Label (M("MAIN_FRAME_BATCHQUEUE") + " [" + Glib::ustring::format( qsize ) + "]" ))); + grid->attach_next_to(*Gtk::manage (new RTImage ("processing-pause.png")), Gtk::POS_RIGHT, 1, 1); + grid->attach_next_to(*Gtk::manage (new Gtk::Label (M("MAIN_FRAME_BATCHQUEUE") + " [" + Glib::ustring::format( qsize ) + "]" )), Gtk::POS_RIGHT, 1, 1); } - hbb->set_spacing (2); - hbb->set_tooltip_markup (M("MAIN_FRAME_BATCHQUEUE_TOOLTIP")); - hbb->show_all (); + grid->set_tooltip_markup (M("MAIN_FRAME_BATCHQUEUE_TOOLTIP")); + grid->show_all (); if (nb) { - nb->set_tab_label(*this, *hbb); + nb->set_tab_label(*this, *grid); } } } diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 6b961d6aa..8a8968990 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -49,7 +49,7 @@ private: private: void prepareProfileBox () { - profileBox.setPreferredWidth (90, 150); + profileBox.set_size_request(90, -1); setExpandAlignProperties (&profileBox, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); profileBox.append (M ("PREFERENCES_PROFILE_NONE")); diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc index b180aff06..fc0dd782b 100644 --- a/rtgui/exifpanel.cc +++ b/rtgui/exifpanel.cc @@ -58,6 +58,11 @@ ExifPanel::ExifPanel () : idata(nullptr) viewcol->pack_start (*render_txt, true); viewcol->add_attribute (*render_pb, "pixbuf", exifColumns.icon); viewcol->add_attribute (*render_txt, "markup", exifColumns.field); + viewcol->set_expand(true); + viewcol->set_resizable (true); + viewcol->set_fixed_width(35); + viewcol->set_min_width(35); + viewcol->set_sizing(Gtk::TREE_VIEW_COLUMN_AUTOSIZE); render_pb->property_ypad() = 0; render_txt->property_ypad() = 0; @@ -71,6 +76,11 @@ ExifPanel::ExifPanel () : idata(nullptr) render_txtv->property_ellipsize() = Pango::ELLIPSIZE_END; viewcolv->pack_start (*render_txtv, true); viewcolv->add_attribute (*render_txtv, "markup", exifColumns.value); + viewcolv->set_expand(true); + viewcolv->set_resizable (true); + viewcol->set_fixed_width(35); + viewcolv->set_min_width(35); + viewcolv->set_sizing(Gtk::TREE_VIEW_COLUMN_AUTOSIZE); render_txtv->property_ypad() = 0; diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index bb66d8834..c95b0d4cb 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -673,17 +673,11 @@ void FileCatalog::_refreshProgressBar () GThreadLock lock; // All GUI acces from idle_add callbacks or separate thread HAVE to be protected Gtk::Notebook *nb = (Gtk::Notebook *)(filepanel->get_parent()); - Gtk::Box* hbb = nullptr; + Gtk::Grid* grid = Gtk::manage (new Gtk::Grid ()); Gtk::Label *label = nullptr; - if( options.mainNBVertical ) { - hbb = Gtk::manage (new Gtk::VBox ()); - } else { - hbb = Gtk::manage (new Gtk::HBox ()); - } - if (!previewsToLoad ) { - hbb->pack_start (*Gtk::manage (new RTImage ("gtk-directory.png"))); + grid->attach_next_to(*Gtk::manage (new RTImage ("gtk-directory.png")), options.mainNBVertical ? Gtk::POS_TOP : Gtk::POS_RIGHT, 1, 1); int filteredCount = min(fileBrowser->getNumFiltered(), previewsLoaded); label = Gtk::manage (new Gtk::Label (M("MAIN_FRAME_FILEBROWSER") + @@ -691,7 +685,7 @@ void FileCatalog::_refreshProgressBar () + Glib::ustring::format(previewsLoaded) + (filteredCount != previewsLoaded ? "]" : ")"))); } else { - hbb->pack_start (*Gtk::manage (new RTImage ("gtk-find.png"))); + grid->attach_next_to(*Gtk::manage (new RTImage ("gtk-find.png")), options.mainNBVertical ? Gtk::POS_TOP : Gtk::POS_RIGHT, 1, 1); label = Gtk::manage (new Gtk::Label (M("MAIN_FRAME_FILEBROWSER") + " [" + Glib::ustring::format(std::fixed, std::setprecision(0), std::setw(3), (double)previewsLoaded / previewsToLoad * 100 ) + "%]" )); filepanel->loadingThumbs("", (double)previewsLoaded / previewsToLoad); } @@ -700,13 +694,12 @@ void FileCatalog::_refreshProgressBar () label->set_angle(90); } - hbb->pack_start (*label); - hbb->set_spacing (2); - hbb->set_tooltip_markup (M("MAIN_FRAME_FILEBROWSER_TOOLTIP")); - hbb->show_all (); + grid->attach_next_to(*label, options.mainNBVertical ? Gtk::POS_TOP : Gtk::POS_RIGHT, 1, 1); + grid->set_tooltip_markup (M("MAIN_FRAME_FILEBROWSER_TOOLTIP")); + grid->show_all (); if (nb) { - nb->set_tab_label(*filepanel, *hbb); + nb->set_tab_label(*filepanel, *grid); } } } diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index 51c5f40e6..e63825d69 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -936,9 +936,8 @@ void MyScrolledWindow::get_preferred_height_for_width_vfunc (int width, int &min natural_height = minimum_height = 50; } -MyComboBoxText::MyComboBoxText () +MyComboBoxText::MyComboBoxText (bool has_entry) : Gtk::ComboBoxText(has_entry) { - minimumWidth = naturalWidth = 70; Gtk::CellRendererText* cellRenderer = dynamic_cast(get_first_cell()); cellRenderer->property_ellipsize() = Pango::ELLIPSIZE_MIDDLE; } @@ -956,39 +955,6 @@ 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) { @@ -1002,33 +968,6 @@ 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; diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index bb96eae40..756f78492 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -273,16 +273,7 @@ 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); }; /** @@ -290,16 +281,10 @@ public: */ 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 (); - - void setPreferredWidth (int minimum_width, int natural_width); + MyComboBoxText (bool has_entry = false); }; /** diff --git a/rtgui/iptcpanel.cc b/rtgui/iptcpanel.cc index efdfc557b..5d0c5ce15 100644 --- a/rtgui/iptcpanel.cc +++ b/rtgui/iptcpanel.cc @@ -26,239 +26,296 @@ using namespace rtengine::procparams; IPTCPanel::IPTCPanel () { - Gtk::Table* iptc = Gtk::manage( new Gtk::Table (27, 2) ); + Gtk::Grid* iptc = Gtk::manage( new Gtk::Grid () ); + setExpandAlignProperties(iptc, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); int row = 0; Gtk::Label* capl = Gtk::manage( new Gtk::Label (M("IPTCPANEL_CAPTION") + ":") ); + setExpandAlignProperties(capl, false, false, Gtk::ALIGN_END, Gtk::ALIGN_START); captionText = Gtk::TextBuffer::create (); captionView = Gtk::manage( new Gtk::TextView (captionText) ); + setExpandAlignProperties(captionView, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); Gtk::ScrolledWindow* scrolledWindowc = Gtk::manage( new Gtk::ScrolledWindow() ); + setExpandAlignProperties(scrolledWindowc, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); scrolledWindowc->set_min_content_height (100); scrolledWindowc->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); scrolledWindowc->add(*captionView); capl->set_tooltip_text (M("IPTCPANEL_CAPTIONHINT")); captionView->set_tooltip_text (M("IPTCPANEL_CAPTIONHINT")); - captionView->set_size_request(32, 80); - iptc->attach (*capl, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*scrolledWindowc, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + captionView->set_size_request(35, 95); + iptc->attach (*capl, 0, row, 1, 1); + iptc->attach (*scrolledWindowc, 1, row, 1, 1); row++; Gtk::Label* capwl = Gtk::manage( new Gtk::Label (M("IPTCPANEL_CAPTIONWRITER") + ":") ); + setExpandAlignProperties(capwl, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE); captionWriter = Gtk::manage( new Gtk::Entry () ); + setExpandAlignProperties(captionWriter, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); capwl->set_tooltip_text (M("IPTCPANEL_CAPTIONWRITERHINT")); captionWriter->set_tooltip_text (M("IPTCPANEL_CAPTIONWRITERHINT")); - iptc->attach (*capwl, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*captionWriter, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + iptc->attach (*capwl, 0, row, 1, 1); + iptc->attach (*captionWriter, 1, row, 1, 1); row++; Gtk::Label* headl = Gtk::manage( new Gtk::Label (M("IPTCPANEL_HEADLINE") + ":") ); + setExpandAlignProperties(headl, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE); headline = Gtk::manage( new Gtk::Entry () ); + setExpandAlignProperties(headline, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); headl->set_tooltip_text (M("IPTCPANEL_HEADLINEHINT")); headline->set_tooltip_text (M("IPTCPANEL_HEADLINEHINT")); - iptc->attach (*headl, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*headline, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + iptc->attach (*headl, 0, row, 1, 1); + iptc->attach (*headline, 1, row, 1, 1); row++; Gtk::Label* instl = Gtk::manage( new Gtk::Label (M("IPTCPANEL_INSTRUCTIONS") + ":") ); + setExpandAlignProperties(instl, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE); instructions = Gtk::manage( new Gtk::Entry () ); + setExpandAlignProperties(instructions, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); instl->set_tooltip_text (M("IPTCPANEL_INSTRUCTIONSHINT")); instructions->set_tooltip_text (M("IPTCPANEL_INSTRUCTIONSHINT")); - iptc->attach (*instl, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*instructions, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + iptc->attach (*instl, 0, row, 1, 1); + iptc->attach (*instructions, 1, row, 1, 1); row++; Gtk::HSeparator* hsep1 = Gtk::manage( new Gtk::HSeparator () ); - iptc->attach (*hsep1, 0, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + setExpandAlignProperties(hsep1, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + iptc->attach (*hsep1, 0, row, 2, 1); row++; Gtk::Label* keyl = Gtk::manage( new Gtk::Label (M("IPTCPANEL_KEYWORDS") + ":")); + setExpandAlignProperties(keyl, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE); + keyl->set_tooltip_text (M("IPTCPANEL_KEYWORDSHINT")); keywords = Gtk::manage( new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE) ); + setExpandAlignProperties(keywords, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); keywords->set_headers_visible (false); - keywords->set_size_request (50, 80); + keywords->set_size_request (50, 95); Gtk::ScrolledWindow* scrolledWindowkw = Gtk::manage( new Gtk::ScrolledWindow() ); + setExpandAlignProperties(scrolledWindowkw, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); scrolledWindowkw->set_min_content_height (100); scrolledWindowkw->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); scrolledWindowkw->add(*keywords); - keyword = Gtk::manage( new Gtk::ComboBoxText (true) ); - keyword->set_size_request (32, -1); - keyl->set_tooltip_text (M("IPTCPANEL_KEYWORDSHINT")); + keyword = Gtk::manage(new MyComboBoxText (true)); + setExpandAlignProperties(keyword, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); + keyword->set_size_request(35); keywords->set_tooltip_text (M("IPTCPANEL_KEYWORDSHINT")); keyword->set_tooltip_text (M("IPTCPANEL_KEYWORDSHINT")); addKW = Gtk::manage( new Gtk::Button () ); + setExpandAlignProperties(addKW, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); delKW = Gtk::manage( new Gtk::Button () ); + setExpandAlignProperties(delKW, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); Gtk::Image* addKWImg = Gtk::manage( new RTImage ("list-add-small.png") ); + setExpandAlignProperties(addKWImg, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); Gtk::Image* delKWImg = Gtk::manage( new RTImage ("list-remove-red-small.png") ); + setExpandAlignProperties(delKWImg, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); addKW->add (*addKWImg); delKW->add (*delKWImg); - Gtk::HBox* kwhb = Gtk::manage( new Gtk::HBox () ); - kwhb->pack_start (*keyword); - kwhb->pack_start (*addKW, Gtk::PACK_SHRINK, 2); - kwhb->pack_start (*delKW, Gtk::PACK_SHRINK, 2); - iptc->attach (*keyl, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*kwhb, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + Gtk::Grid* kwgrid = Gtk::manage( new Gtk::Grid () ); + setExpandAlignProperties(kwgrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); + kwgrid->attach (*keyword, 0, 0, 1, 1); + kwgrid->attach (*addKW, 1, 0, 1, 1); + kwgrid->attach (*delKW, 2, 0, 1, 1); + iptc->attach (*keyl, 0, row, 1, 1); + iptc->attach (*kwgrid, 1, row, 1, 1); row++; - iptc->attach (*scrolledWindowkw, 0, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + iptc->attach (*scrolledWindowkw, 0, row, 2, 1); row++; Gtk::HSeparator* hsep2 = Gtk::manage( new Gtk::HSeparator () ); - iptc->attach (*hsep2, 0, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + setExpandAlignProperties(hsep2, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + iptc->attach (*hsep2, 0, row, 2, 1); row++; Gtk::Label* catl = Gtk::manage( new Gtk::Label (M("IPTCPANEL_CATEGORY") + ":") ); - category = Gtk::manage( new Gtk::ComboBoxText (true) ); - category->set_size_request (32, -1); + setExpandAlignProperties(catl, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE); + category = Gtk::manage(new MyComboBoxText (true)); + category->set_size_request(35); + setExpandAlignProperties(category, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); catl->set_tooltip_text (M("IPTCPANEL_CATEGORYHINT")); category->set_tooltip_text (M("IPTCPANEL_CATEGORYHINT")); Gtk::Label* scl = Gtk::manage( new Gtk::Label (M("IPTCPANEL_SUPPCATEGORIES") + ":") ); + setExpandAlignProperties(scl, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE); suppCategories = Gtk::manage( new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE) ); + setExpandAlignProperties(suppCategories, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); suppCategories->set_headers_visible (false); - suppCategories->set_size_request(50, 80); + suppCategories->set_size_request(50, 95); Gtk::ScrolledWindow* scrolledWindowsc = Gtk::manage( new Gtk::ScrolledWindow() ); + setExpandAlignProperties(scrolledWindowsc, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); scrolledWindowsc->set_min_content_height (100); scrolledWindowsc->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); scrolledWindowsc->add(*suppCategories); - suppCategory = Gtk::manage( new Gtk::ComboBoxText (true) ); - suppCategory->set_size_request (32, -1); + suppCategory = Gtk::manage(new MyComboBoxText (true)); + suppCategory->set_size_request(35); + setExpandAlignProperties(suppCategory, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); scl->set_tooltip_text (M("IPTCPANEL_SUPPCATEGORIESHINT")); suppCategories->set_tooltip_text (M("IPTCPANEL_SUPPCATEGORIESHINT")); suppCategory->set_tooltip_text (M("IPTCPANEL_SUPPCATEGORIESHINT")); addSC = Gtk::manage( new Gtk::Button () ); + setExpandAlignProperties(addSC, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); delSC = Gtk::manage( new Gtk::Button () ); + setExpandAlignProperties(delSC, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); Gtk::Image* addSCImg = Gtk::manage( new RTImage ("list-add-small.png") ); + setExpandAlignProperties(addSCImg, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); Gtk::Image* delSCImg = Gtk::manage( new RTImage ("list-remove-red-small.png") ); + setExpandAlignProperties(delSCImg, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); addSC->add (*addSCImg); delSC->add (*delSCImg); - Gtk::HBox* schb = Gtk::manage( new Gtk::HBox () ); - schb->pack_start (*suppCategory); - schb->pack_start (*addSC, Gtk::PACK_SHRINK, 2); - schb->pack_start (*delSC, Gtk::PACK_SHRINK, 2); - iptc->attach (*catl, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*category, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + Gtk::Grid* scgrid = Gtk::manage( new Gtk::Grid () ); + setExpandAlignProperties(scgrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); + scgrid->attach (*suppCategory, 0, 0, 1, 1); + scgrid->attach (*addSC, 1, 0, 1, 1); + scgrid->attach (*delSC, 2, 0, 1, 1); + iptc->attach (*catl, 0, row, 1, 1); + iptc->attach (*category, 1, row, 1, 1); row++; - iptc->attach (*scl, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*schb, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + iptc->attach (*scl, 0, row, 1, 1); + iptc->attach (*scgrid, 1, row, 1, 1); row++; - iptc->attach (*scrolledWindowsc, 0, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + iptc->attach (*scrolledWindowsc, 0, row, 2, 1); row++; Gtk::HSeparator* hsep3 = Gtk::manage( new Gtk::HSeparator () ); - iptc->attach (*hsep3, 0, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + setExpandAlignProperties(hsep3, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + iptc->attach (*hsep3, 0, row, 2, 1); row++; Gtk::Label* authl = Gtk::manage( new Gtk::Label (M("IPTCPANEL_AUTHOR") + ":") ); + setExpandAlignProperties(authl, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE); author = Gtk::manage( new Gtk::Entry () ); + setExpandAlignProperties(author, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); authl->set_tooltip_text (M("IPTCPANEL_CREDITHINT")); author->set_tooltip_text (M("IPTCPANEL_CREDITHINT")); - iptc->attach (*authl, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*author, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + iptc->attach (*authl, 0, row, 1, 1); + iptc->attach (*author, 1, row, 1, 1); row++; Gtk::Label* aupl = Gtk::manage( new Gtk::Label (M("IPTCPANEL_AUTHORSPOSITION") + ":") ); + setExpandAlignProperties(aupl, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE); authorPos = Gtk::manage( new Gtk::Entry () ); + setExpandAlignProperties(authorPos, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); aupl->set_tooltip_text (M("IPTCPANEL_AUTHORSPOSITIONHINT")); authorPos->set_tooltip_text (M("IPTCPANEL_AUTHORSPOSITIONHINT")); - iptc->attach (*aupl, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*authorPos, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + iptc->attach (*aupl, 0, row, 1, 1); + iptc->attach (*authorPos, 1, row, 1, 1); row++; Gtk::Label* credl = Gtk::manage( new Gtk::Label (M("IPTCPANEL_CREDIT") + ":") ); + setExpandAlignProperties(credl, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE); credit = Gtk::manage( new Gtk::Entry () ); + setExpandAlignProperties(credit, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); credl->set_tooltip_text (M("IPTCPANEL_CREDITHINT")); credit->set_tooltip_text (M("IPTCPANEL_CREDITHINT")); - iptc->attach (*credl, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*credit, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + iptc->attach (*credl, 0, row, 1, 1); + iptc->attach (*credit, 1, row, 1, 1); row++; Gtk::Label* sourl = Gtk::manage( new Gtk::Label (M("IPTCPANEL_SOURCE") + ":") ); + setExpandAlignProperties(sourl, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE); source = Gtk::manage( new Gtk::Entry () ); + setExpandAlignProperties(source, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); sourl->set_tooltip_text (M("IPTCPANEL_SOURCEHINT")); source->set_tooltip_text (M("IPTCPANEL_SOURCEHINT")); - iptc->attach (*sourl, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*source, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + iptc->attach (*sourl, 0, row, 1, 1); + iptc->attach (*source, 1, row, 1, 1); row++; Gtk::Label* cprl = Gtk::manage( new Gtk::Label (M("IPTCPANEL_COPYRIGHT") + ":") ); + setExpandAlignProperties(cprl, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE); copyright = Gtk::manage( new Gtk::Entry () ); + setExpandAlignProperties(copyright, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); cprl->set_tooltip_text (M("IPTCPANEL_COPYRIGHTHINT")); copyright->set_tooltip_text (M("IPTCPANEL_COPYRIGHTHINT")); - iptc->attach (*cprl, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*copyright, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + iptc->attach (*cprl, 0, row, 1, 1); + iptc->attach (*copyright, 1, row, 1, 1); row++; Gtk::HSeparator* hsep4 = Gtk::manage( new Gtk::HSeparator () ); - iptc->attach (*hsep4, 0, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + setExpandAlignProperties(hsep4, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + iptc->attach (*hsep4, 0, row, 2, 1); row++; Gtk::Label* cityl = Gtk::manage( new Gtk::Label (M("IPTCPANEL_CITY") + ":") ); + setExpandAlignProperties(cityl, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE); city = Gtk::manage( new Gtk::Entry () ); + setExpandAlignProperties(city, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); cityl->set_tooltip_text (M("IPTCPANEL_CITYHINT")); city->set_tooltip_text (M("IPTCPANEL_CITYHINT")); - iptc->attach (*cityl, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*city, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + iptc->attach (*cityl, 0, row, 1, 1); + iptc->attach (*city, 1, row, 1, 1); row++; Gtk::Label* provl = Gtk::manage( new Gtk::Label (M("IPTCPANEL_PROVINCE") + ":") ); + setExpandAlignProperties(provl, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE); province = Gtk::manage( new Gtk::Entry () ); + setExpandAlignProperties(province, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); provl->set_tooltip_text (M("IPTCPANEL_PROVINCEHINT")); province->set_tooltip_text (M("IPTCPANEL_PROVINCEHINT")); - iptc->attach (*provl, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*province, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + iptc->attach (*provl, 0, row, 1, 1); + iptc->attach (*province, 1, row, 1, 1); row++; Gtk::Label* ctrl = Gtk::manage( new Gtk::Label (M("IPTCPANEL_COUNTRY") + ":") ); + setExpandAlignProperties(ctrl, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE); country = Gtk::manage( new Gtk::Entry () ); + setExpandAlignProperties(country, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); ctrl->set_tooltip_text (M("IPTCPANEL_COUNTRYHINT")); country->set_tooltip_text (M("IPTCPANEL_COUNTRYHINT")); - iptc->attach (*ctrl, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*country, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + iptc->attach (*ctrl, 0, row, 1, 1); + iptc->attach (*country, 1, row, 1, 1); row++; Gtk::Label* titll = Gtk::manage( new Gtk::Label (M("IPTCPANEL_TITLE") + ":") ); + setExpandAlignProperties(titll, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE); title = Gtk::manage( new Gtk::Entry () ); + setExpandAlignProperties(title, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); titll->set_tooltip_text (M("IPTCPANEL_TITLEHINT")); title->set_tooltip_text (M("IPTCPANEL_TITLEHINT")); - iptc->attach (*titll, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*title, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + iptc->attach (*titll, 0, row, 1, 1); + iptc->attach (*title, 1, row, 1, 1); row++; Gtk::Label* dcl = Gtk::manage( new Gtk::Label (M("IPTCPANEL_DATECREATED") + ":") ); + setExpandAlignProperties(dcl, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE); dateCreated = Gtk::manage( new Gtk::Entry () ); + setExpandAlignProperties(dateCreated, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); dcl->set_tooltip_text (M("IPTCPANEL_DATECREATEDHINT")); dateCreated->set_tooltip_text (M("IPTCPANEL_DATECREATEDHINT")); - iptc->attach (*dcl, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*dateCreated, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + iptc->attach (*dcl, 0, row, 1, 1); + iptc->attach (*dateCreated, 1, row, 1, 1); row++; Gtk::Label* trl = Gtk::manage( new Gtk::Label (M("IPTCPANEL_TRANSREFERENCE") + ":") ); + setExpandAlignProperties(trl, false, false, Gtk::ALIGN_END, Gtk::ALIGN_BASELINE); transReference = Gtk::manage( new Gtk::Entry () ); + setExpandAlignProperties(transReference, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_BASELINE); trl->set_tooltip_text (M("IPTCPANEL_TRANSREFERENCEHINT")); transReference->set_tooltip_text (M("IPTCPANEL_TRANSREFERENCEHINT")); - iptc->attach (*trl, 0, 1, row, row + 1, Gtk::SHRINK, Gtk::SHRINK, 2, 2); - iptc->attach (*transReference, 1, 2, row, row + 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK, 2, 2); + iptc->attach (*trl, 0, row, 1, 1); + iptc->attach (*transReference, 1, row, 1, 1); row++; Gtk::ScrolledWindow* scrolledWindow = Gtk::manage( new Gtk::ScrolledWindow() ); + setExpandAlignProperties(scrolledWindow, false, true, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL); scrolledWindow->set_shadow_type(Gtk::SHADOW_NONE); scrolledWindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); - scrolledWindow->property_window_placement().set_value(Gtk::CORNER_TOP_LEFT); + scrolledWindow->property_window_placement().set_value(Gtk::CORNER_TOP_RIGHT); scrolledWindow->add(*iptc); pack_start (*scrolledWindow); diff --git a/rtgui/iptcpanel.h b/rtgui/iptcpanel.h index 891231eb5..d17a7d02b 100644 --- a/rtgui/iptcpanel.h +++ b/rtgui/iptcpanel.h @@ -36,12 +36,12 @@ private: Gtk::Entry* captionWriter; Gtk::Entry* headline; Gtk::Entry* instructions; - Gtk::ComboBoxText* keyword; + MyComboBoxText* keyword; Gtk::ListViewText* keywords; Gtk::Button* addKW; Gtk::Button* delKW; - Gtk::ComboBoxText* category; - Gtk::ComboBoxText* suppCategory; + MyComboBoxText* category; + MyComboBoxText* suppCategory; Gtk::ListViewText* suppCategories; Gtk::Button* addSC; Gtk::Button* delSC; diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index 825a5d764..e87833de9 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -53,44 +53,40 @@ ProfilePanel::ProfilePanel () : storedPProfile(nullptr), lastFilename(""), image fillMode->add( options.filledProfile ? *profileFillModeOnImage : *profileFillModeOffImage ); fillMode->signal_toggled().connect ( sigc::mem_fun(*this, &ProfilePanel::profileFillModeToggled) ); fillMode->set_tooltip_text(M("PROFILEPANEL_MODE_TIP")); - fillMode->set_margin_right(2); - setExpandAlignProperties(fillMode, false, true, Gtk::ALIGN_START, Gtk::ALIGN_FILL); + setExpandAlignProperties(fillMode, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); // Create the Combobox profiles = Gtk::manage (new ProfileStoreComboBox ()); setExpandAlignProperties(profiles, true, true, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL); - - Gtk::Grid* hgrid = Gtk::manage (new Gtk::Grid ()); - hgrid->show (); - setExpandAlignProperties(hgrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_START); - - pack_start (*hgrid, Gtk::PACK_SHRINK, 4); - + profiles->set_size_request(90); load = Gtk::manage (new Gtk::Button ()); load->add (*Gtk::manage (new RTImage ("gtk-open.png"))); load->get_style_context()->add_class("Left"); load->set_margin_left(2); - setExpandAlignProperties(load, false, true, Gtk::ALIGN_END, Gtk::ALIGN_FILL); + setExpandAlignProperties(load, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); save = Gtk::manage (new Gtk::Button ()); save->add (*Gtk::manage (new RTImage ("gtk-save-large.png"))); save->get_style_context()->add_class("MiddleH"); - setExpandAlignProperties(save, false, true, Gtk::ALIGN_END, Gtk::ALIGN_FILL); + setExpandAlignProperties(save, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); copy = Gtk::manage (new Gtk::Button ()); copy->add (*Gtk::manage (new RTImage ("edit-copy.png"))); copy->get_style_context()->add_class("MiddleH"); - setExpandAlignProperties(copy, false, true, Gtk::ALIGN_END, Gtk::ALIGN_FILL); + setExpandAlignProperties(copy, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); paste = Gtk::manage (new Gtk::Button ()); paste->add (*Gtk::manage (new RTImage ("edit-paste.png"))); paste->get_style_context()->add_class("Right"); - setExpandAlignProperties(paste, false, true, Gtk::ALIGN_END, Gtk::ALIGN_FILL); + setExpandAlignProperties(paste, false, true, Gtk::ALIGN_CENTER, Gtk::ALIGN_FILL); - hgrid->attach (*fillMode, 0, 0, 1, 1); - hgrid->attach (*profiles, 1, 0, 1, 1); - hgrid->attach (*load, 2, 0, 1, 1); - hgrid->attach (*save, 3, 0, 1, 1); - hgrid->attach (*copy, 4, 0, 1, 1); - hgrid->attach (*paste, 5, 0, 1, 1); + attach_next_to (*fillMode, Gtk::POS_RIGHT, 1, 1); + attach_next_to (*profiles, Gtk::POS_RIGHT, 1, 1); + attach_next_to (*load, Gtk::POS_RIGHT, 1, 1); + attach_next_to (*save, Gtk::POS_RIGHT, 1, 1); + attach_next_to (*copy, Gtk::POS_RIGHT, 1, 1); + attach_next_to (*paste, Gtk::POS_RIGHT, 1, 1); + + setExpandAlignProperties(this, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER); + show (); load->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &ProfilePanel::load_clicked) ); save->signal_button_release_event().connect_notify( sigc::mem_fun(*this, &ProfilePanel::save_clicked) ); diff --git a/rtgui/profilepanel.h b/rtgui/profilepanel.h index cc442755a..8293c1803 100644 --- a/rtgui/profilepanel.h +++ b/rtgui/profilepanel.h @@ -29,7 +29,7 @@ #include "guiutils.h" #include "rtimage.h" -class ProfilePanel : public Gtk::VBox, public PParamsChangeListener, public ProfileStoreListener +class ProfilePanel : public Gtk::Grid, public PParamsChangeListener, public ProfileStoreListener { private: diff --git a/rtgui/profilestore.cc b/rtgui/profilestore.cc index 5f4c51937..673992e97 100644 --- a/rtgui/profilestore.cc +++ b/rtgui/profilestore.cc @@ -518,6 +518,7 @@ ProfileStoreComboBox::ProfileStoreComboBox () updateProfileList(); Gtk::CellRendererText* cellRenderer = dynamic_cast(get_first_cell()); cellRenderer->property_ellipsize() = Pango::ELLIPSIZE_MIDDLE; + cellRenderer->property_ellipsize_set() = true; } Glib::ustring ProfileStoreComboBox::getCurrentLabel() diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 23a8c895f..095a3cf0d 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -179,11 +179,11 @@ RTWindow::RTWindow () if (options.mainNBVertical) { mainNB->set_tab_pos (Gtk::POS_LEFT); fpl->set_angle (90); - fpanelLabelGrid->attach_next_to(*fpl, Gtk::POS_BOTTOM, 1, 1); - fpanelLabelGrid->attach_next_to(*Gtk::manage (new RTImage ("gtk-directory.png")), Gtk::POS_BOTTOM, 1, 1); + fpanelLabelGrid->attach_next_to(*Gtk::manage (new RTImage ("gtk-directory.png")), Gtk::POS_TOP, 1, 1); + fpanelLabelGrid->attach_next_to(*fpl, Gtk::POS_TOP, 1, 1); } else { - fpanelLabelGrid->attach_next_to(*fpl, Gtk::POS_LEFT, 1, 1); - fpanelLabelGrid->attach_next_to(*Gtk::manage (new RTImage ("gtk-directory.png")), Gtk::POS_LEFT, 1, 1); + fpanelLabelGrid->attach_next_to(*Gtk::manage (new RTImage ("gtk-directory.png")), Gtk::POS_RIGHT, 1, 1); + fpanelLabelGrid->attach_next_to(*fpl, Gtk::POS_RIGHT, 1, 1); } fpanelLabelGrid->set_tooltip_markup (M("MAIN_FRAME_FILEBROWSER_TOOLTIP")); @@ -215,11 +215,11 @@ RTWindow::RTWindow () if (options.mainNBVertical) { el->set_angle (90); - editorLabelGrid->attach_next_to(*el, Gtk::POS_BOTTOM, 1, 1); - editorLabelGrid->attach_next_to(*Gtk::manage (new RTImage ("rt-logo-small.png")), Gtk::POS_BOTTOM, 1, 1); + editorLabelGrid->attach_next_to(*Gtk::manage (new RTImage ("rt-logo-small.png")), Gtk::POS_TOP, 1, 1); + editorLabelGrid->attach_next_to(*el, Gtk::POS_TOP, 1, 1); } else { - editorLabelGrid->attach_next_to(*el, Gtk::POS_LEFT, 1, 1); - editorLabelGrid->attach_next_to(*Gtk::manage (new RTImage ("rt-logo-small.png")), Gtk::POS_LEFT, 1, 1); + editorLabelGrid->attach_next_to(*Gtk::manage (new RTImage ("rt-logo-small.png")), Gtk::POS_RIGHT, 1, 1); + editorLabelGrid->attach_next_to(*el, Gtk::POS_RIGHT, 1, 1); } editorLabelGrid->set_tooltip_markup (M("MAIN_FRAME_EDITOR_TOOLTIP")); @@ -437,23 +437,20 @@ void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) ep->setParent (this); // construct closeable tab for the image - Gtk::HBox* hb = Gtk::manage (new Gtk::HBox ()); - hb->pack_start (*Gtk::manage (new RTImage ("rtwindow.png"))); - hb->pack_start (*Gtk::manage (new Gtk::Label (Glib::path_get_basename (name)))); - hb->set_tooltip_markup (name); + Gtk::Grid* titleGrid = Gtk::manage (new Gtk::Grid ()); + titleGrid->set_tooltip_markup (name); Gtk::Button* closeb = Gtk::manage (new Gtk::Button ()); closeb->set_image (*Gtk::manage(new RTImage ("gtk-close.png"))); closeb->set_relief (Gtk::RELIEF_NONE); closeb->set_focus_on_click (false); - // make the button as small as possible - printf("TODO: make #tabClose as smalla s possible through css\n"); - closeb->signal_clicked().connect( sigc::bind (sigc::mem_fun(*this, &RTWindow::remEditorPanel) , ep)); - hb->pack_end (*closeb); - hb->set_spacing (2); - hb->show_all (); - mainNB->append_page (*ep, *hb); + titleGrid->attach_next_to(*Gtk::manage (new RTImage ("rtwindow.png")), Gtk::POS_RIGHT, 1, 1); + titleGrid->attach_next_to(*Gtk::manage (new Gtk::Label (Glib::path_get_basename (name))), Gtk::POS_RIGHT, 1, 1); + titleGrid->attach_next_to(*closeb, Gtk::POS_RIGHT, 1, 1); + titleGrid->show_all (); + + mainNB->append_page (*ep, *titleGrid); //ep->setAspect (); mainNB->set_current_page (mainNB->page_num (*ep)); mainNB->set_tab_reorderable (*ep, true);