diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 5f335f6d4..1e972506a 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -46,6 +46,8 @@ private: void prepareProfileBox () { profileBox.set_size_request (100, -1); + profileBox.setPreferredWidth(90, 150); + setExpandAlignProperties(&profileBox, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); profileBox.append (M("PREFERENCES_PROFILE_NONE")); #ifdef WIN32 @@ -66,6 +68,7 @@ private: intentBox.addEntry("intent-relative.png", M("PREFERENCES_INTENT_RELATIVE")); intentBox.addEntry("intent-perceptual.png", M("PREFERENCES_INTENT_PERCEPTUAL")); intentBox.addEntry("intent-absolute.png", M("PREFERENCES_INTENT_ABSOLUTE")); + setExpandAlignProperties(intentBox.buttonGroup, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); intentBox.setSelected(0); intentBox.show (); @@ -167,10 +170,10 @@ public: intentConn = intentBox.signal_changed ().connect (sigc::mem_fun (this, &MonitorProfileSelector::intentBoxChanged)); } - void pack_end_in (Gtk::Box* box) + void pack_right_in (Gtk::Grid* grid) { - box->pack_end (*intentBox.buttonGroup, Gtk::PACK_SHRINK, 0); - box->pack_end (profileBox, Gtk::PACK_SHRINK, 0); + grid->attach_next_to(profileBox, Gtk::POS_RIGHT, 1, 1); + grid->attach_next_to(*intentBox.buttonGroup, Gtk::POS_RIGHT, 1, 1); } void reset () @@ -296,19 +299,15 @@ EditorPanel::EditorPanel (FilePanel* filePanel) tbTopPanel_1->set_image (*iTopPanel_1_Hide); } - tbRightPanel_1 = new Gtk::ToggleButton (); - iRightPanel_1_Show = new RTImage ("panel-to-left.png"); - iRightPanel_1_Hide = new RTImage ("panel-to-right.png"); - tbRightPanel_1->set_relief(Gtk::RELIEF_NONE); - tbRightPanel_1->set_active (true); - tbRightPanel_1->set_tooltip_markup (M("MAIN_TOOLTIP_SHOWHIDERP1")); - tbRightPanel_1->set_image (*iRightPanel_1_Hide); - Gtk::VSeparator* vsepcl = Gtk::manage (new Gtk::VSeparator ()); Gtk::VSeparator* vsepz2 = Gtk::manage (new Gtk::VSeparator ()); Gtk::VSeparator* vsepz3 = Gtk::manage (new Gtk::VSeparator ()); Gtk::VSeparator* vsepz4 = Gtk::manage (new Gtk::VSeparator ()); + Gtk::VSeparator* vsep1 = Gtk::manage (new Gtk::VSeparator ()); + Gtk::VSeparator* vsep2 = Gtk::manage (new Gtk::VSeparator ()); + Gtk::VSeparator* vsep3 = Gtk::manage (new Gtk::VSeparator ()); + iareapanel = new ImageAreaPanel (); tpc->setEditProvider(iareapanel->imageArea); @@ -323,9 +322,9 @@ EditorPanel::EditorPanel (FilePanel* filePanel) toolBarPanel->pack_start (*vsept, Gtk::PACK_SHRINK, 2); if (tbTopPanel_1) { + Gtk::VSeparator* vsep = Gtk::manage (new Gtk::VSeparator ()); toolBarPanel->pack_end (*tbTopPanel_1, Gtk::PACK_SHRINK, 1); - Gtk::VSeparator* vsep1 = Gtk::manage (new Gtk::VSeparator ()); - toolBarPanel->pack_end (*vsep1, Gtk::PACK_SHRINK, 2); + toolBarPanel->pack_end (*vsep, Gtk::PACK_SHRINK, 2); } toolBarPanel->pack_end (*tpc->coarse, Gtk::PACK_SHRINK, 2); @@ -355,56 +354,51 @@ EditorPanel::EditorPanel (FilePanel* filePanel) vboxright->pack_start (*tpc->toolPanelNotebook); // Save buttons - Gtk::HBox* iops = Gtk::manage (new Gtk::HBox ()); - iops->set_spacing(2); - - Gtk::HBox *exportButtonsHBox = Gtk::manage (new Gtk::HBox ()); + Gtk::Grid *iops = new Gtk::Grid (); + iops->set_orientation(Gtk::ORIENTATION_HORIZONTAL); + iops->set_row_spacing(2); + iops->set_column_spacing(2); Gtk::Image *saveButtonImage = Gtk::manage (new RTImage ("gtk-save-large.png")); saveimgas = Gtk::manage (new Gtk::Button ()); saveimgas->add(*saveButtonImage); saveimgas->set_tooltip_markup(M("MAIN_BUTTON_SAVE_TOOLTIP")); + setExpandAlignProperties(saveimgas, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); Gtk::Image *queueButtonImage = Gtk::manage (new RTImage ("processing.png")); queueimg = Gtk::manage (new Gtk::Button ()); queueimg->add(*queueButtonImage); queueimg->set_tooltip_markup(M("MAIN_BUTTON_PUTTOQUEUE_TOOLTIP")); + setExpandAlignProperties(queueimg, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); Gtk::Image *sendToEditorButtonImage = Gtk::manage (new RTImage ("image-editor.png")); sendtogimp = Gtk::manage (new Gtk::Button ()); sendtogimp->add(*sendToEditorButtonImage); sendtogimp->set_tooltip_markup(M("MAIN_BUTTON_SENDTOEDITOR_TOOLTIP")); - - exportButtonsHBox->pack_start (*saveimgas, Gtk::PACK_SHRINK); - - if(!simpleEditor) { - exportButtonsHBox->pack_start (*queueimg, Gtk::PACK_SHRINK); - } - - exportButtonsHBox->pack_start (*sendtogimp, Gtk::PACK_SHRINK); - - iops->pack_start (*exportButtonsHBox, Gtk::PACK_SHRINK); - iops->pack_start (*Gtk::manage(new Gtk::VSeparator()), Gtk::PACK_SHRINK, 1); + setExpandAlignProperties(sendtogimp, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); // Status box - statusBox = Gtk::manage (new Gtk::HBox ()); cssProvider = Gtk::CssProvider::create(); - progressLabel = Gtk::manage (new Gtk::ProgressBar()); + progressLabel = Gtk::manage (new MyProgressBar(300)); progressLabel->set_show_text(true); - setExpandAlignProperties(progressLabel, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); + setExpandAlignProperties(progressLabel, true, false, Gtk::ALIGN_START, Gtk::ALIGN_CENTER); progressLabel->set_fraction(0.0); // TODO is this needed? What for? - if (cssProvider) { + /*if (cssProvider) { progressLabel->get_style_context()->add_provider (cssProvider, GTK_STYLE_PROVIDER_PRIORITY_USER); // Can't find the gtkmm version of the enum! - } + }*/ - statusBox->pack_start (*progressLabel); - iops->pack_start (*statusBox, Gtk::PACK_EXPAND_PADDING, 2); - iops->pack_start (*Gtk::manage(new Gtk::VSeparator()), Gtk::PACK_SHRINK, 1); // tbRightPanel_1 - iops->pack_end (*tbRightPanel_1, Gtk::PACK_SHRINK, 0); + tbRightPanel_1 = new Gtk::ToggleButton (); + iRightPanel_1_Show = new RTImage ("panel-to-left.png"); + iRightPanel_1_Hide = new RTImage ("panel-to-right.png"); + tbRightPanel_1->set_relief(Gtk::RELIEF_NONE); + tbRightPanel_1->set_active (true); + tbRightPanel_1->set_tooltip_markup (M("MAIN_TOOLTIP_SHOWHIDERP1")); + tbRightPanel_1->set_image (*iRightPanel_1_Hide); + setExpandAlignProperties(tbRightPanel_1, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); // ShowHideSidePanels tbShowHideSidePanels = new Gtk::ToggleButton (); @@ -414,12 +408,9 @@ EditorPanel::EditorPanel (FilePanel* filePanel) tbShowHideSidePanels->set_active (false); tbShowHideSidePanels->set_tooltip_markup (M("MAIN_BUTTON_SHOWHIDESIDEPANELS_TOOLTIP")); tbShowHideSidePanels->set_image (*iShowHideSidePanels); - iops->pack_end (*tbShowHideSidePanels, Gtk::PACK_SHRINK, 0); - iops->pack_end (*vsepz2, Gtk::PACK_SHRINK, 1); + setExpandAlignProperties(tbShowHideSidePanels, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); - // Zoom panel - iops->pack_end (*iareapanel->imageArea->zoomPanel, Gtk::PACK_SHRINK, 1); - iops->pack_end (*vsepz3, Gtk::PACK_SHRINK, 2); + monitorProfile.reset (new MonitorProfileSelector (ipc)); navPrev = navNext = navSync = NULL; @@ -431,6 +422,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) navPrev->add(*navPrevImage); navPrev->set_relief(Gtk::RELIEF_NONE); navPrev->set_tooltip_markup(M("MAIN_BUTTON_NAVPREV_TOOLTIP")); + setExpandAlignProperties(navPrev, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); Gtk::Image *navNextImage = Gtk::manage (new RTImage ("nav-next.png")); navNextImage->set_padding(0, 0); @@ -438,6 +430,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) navNext->add(*navNextImage); navNext->set_relief(Gtk::RELIEF_NONE); navNext->set_tooltip_markup(M("MAIN_BUTTON_NAVNEXT_TOOLTIP")); + setExpandAlignProperties(navNext, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); Gtk::Image *navSyncImage = Gtk::manage (new RTImage ("nav-sync.png")); navSyncImage->set_padding(0, 0); @@ -445,19 +438,36 @@ EditorPanel::EditorPanel (FilePanel* filePanel) navSync->add(*navSyncImage); navSync->set_relief(Gtk::RELIEF_NONE); navSync->set_tooltip_markup(M("MAIN_BUTTON_NAVSYNC_TOOLTIP")); - - iops->pack_end (*navNext, Gtk::PACK_SHRINK, 0); - iops->pack_end (*navSync, Gtk::PACK_SHRINK, 0); - iops->pack_end (*navPrev, Gtk::PACK_SHRINK, 0); + setExpandAlignProperties(navSync, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); } - iops->pack_end (*Gtk::manage(new Gtk::VSeparator()), Gtk::PACK_SHRINK, 0); + // ================== PACKING THE BOTTOM WIDGETS ================= - // Monitor profile buttons - monitorProfile.reset (new MonitorProfileSelector (ipc)); - monitorProfile->pack_end_in (iops); + // Adding widgets from center to the left, on the left side (using Gtk::POS_LEFT) + //iops->attach_next_to(*vsep2, Gtk::POS_LEFT, 1, 1); + iops->attach_next_to(*progressLabel, Gtk::POS_LEFT, 1, 1); + iops->attach_next_to(*vsep1, Gtk::POS_LEFT, 1, 1); + iops->attach_next_to(*sendtogimp, Gtk::POS_LEFT, 1, 1); + if(!simpleEditor) { + iops->attach_next_to(*queueimg, Gtk::POS_LEFT, 1, 1); + } + iops->attach_next_to(*saveimgas, Gtk::POS_LEFT, 1, 1); + + // Adding widgets from center to the right, on the right side (using Gtk::POS_RIGHT) + iops->attach_next_to(*vsep2, Gtk::POS_RIGHT, 1, 1); + monitorProfile->pack_right_in (iops); + if (!simpleEditor && !options.tabbedUI) { + iops->attach_next_to(*vsep3, Gtk::POS_RIGHT, 1, 1); + iops->attach_next_to(*navPrev, Gtk::POS_RIGHT, 1, 1); + iops->attach_next_to(*navSync, Gtk::POS_RIGHT, 1, 1); + iops->attach_next_to(*navNext, Gtk::POS_RIGHT, 1, 1); + } + iops->attach_next_to(*vsepz2, Gtk::POS_RIGHT, 1, 1); + iops->attach_next_to(*iareapanel->imageArea->zoomPanel, Gtk::POS_RIGHT, 1, 1); + iops->attach_next_to(*vsepz3, Gtk::POS_RIGHT, 1, 1); + iops->attach_next_to(*tbShowHideSidePanels, Gtk::POS_RIGHT, 1, 1); + iops->attach_next_to(*tbRightPanel_1, Gtk::POS_RIGHT, 1, 1); - editbox->pack_start (*Gtk::manage(new Gtk::HSeparator()), Gtk::PACK_SHRINK, 0); editbox->pack_start (*iops, Gtk::PACK_SHRINK, 0); editbox->show_all (); @@ -890,7 +900,7 @@ void EditorPanel::setProgressState (bool inProcessing) struct spparams { double val; Glib::ustring str; - Gtk::ProgressBar *pProgress; + MyProgressBar *pProgress; Glib::RefPtr cssProvider; }; diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index ab52ebcc7..48c815de0 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -36,6 +36,8 @@ #include "filepanel.h" class EditorPanel; +class MyProgressBar; + struct EditorPanelIdleHelper { EditorPanel* epanel; bool destroyed; @@ -57,7 +59,7 @@ private: Glib::RefPtr cssProvider; // to be able to set the ProgressBar's background protected: - Gtk::ProgressBar *progressLabel; + MyProgressBar *progressLabel; Gtk::ToggleButton* info; Gtk::ToggleButton* hidehp; Gtk::ToggleButton* tbShowHideSidePanels; @@ -68,7 +70,6 @@ protected: Gtk::ToggleButton* beforeAfter; Gtk::HPaned* hpanedl; Gtk::HPaned* hpanedr; - Gtk::HBox* statusBox; Gtk::Image *iHistoryShow, *iHistoryHide; Gtk::Image *iTopPanel_1_Show, *iTopPanel_1_Hide; Gtk::Image *iRightPanel_1_Show, *iRightPanel_1_Hide; diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index 7169404bf..58fdeb4fc 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -966,7 +966,7 @@ void MyScrolledWindow::get_preferred_height_for_width_vfunc (int width, int &min MyComboBoxText::MyComboBoxText () { - set_size_request(40, -1); + minimumWidth = naturalWidth = 70; } bool MyComboBoxText::on_scroll_event (GdkEventScroll* event) @@ -982,19 +982,37 @@ 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 { - minimum_width = natural_width = 70; + natural_width = rtengine::max(naturalWidth, 10); + minimum_width = rtengine::max(minimumWidth, 10); } void MyComboBoxText::get_preferred_width_for_height_vfunc (int width, int &minimum_width, int &natural_width) const { - minimum_width = natural_width = 70; + natural_width = rtengine::max(naturalWidth, 10); + minimum_width = rtengine::max(minimumWidth, 10); } MyComboBox::MyComboBox () { - set_size_request(40, -1); + minimumWidth = naturalWidth = 70; } bool MyComboBox::on_scroll_event (GdkEventScroll* event) @@ -1010,13 +1028,31 @@ 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 { - minimum_width = natural_width = 70; + natural_width = rtengine::max(naturalWidth, 10); + minimum_width = rtengine::max(minimumWidth, 10); } void MyComboBox::get_preferred_width_for_height_vfunc (int width, int &minimum_width, int &natural_width) const { - minimum_width = natural_width = 70; + natural_width = rtengine::max(naturalWidth, 10); + minimum_width = rtengine::max(minimumWidth, 10); } MySpinButton::MySpinButton () @@ -1256,6 +1292,24 @@ const Gtk::Label* MyImageMenuItem::getLabel () const return label; } +MyProgressBar::MyProgressBar(int width) : w(rtengine::max(width, 10)) {} +MyProgressBar::MyProgressBar() : w(200) {} + +void MyProgressBar::setPreferredWidth(int width) +{ + w = rtengine::max(width, 10); +} + +void MyProgressBar::get_preferred_width_vfunc (int &minimum_width, int &natural_width) const +{ + minimum_width = rtengine::max(w/2, 50); + natural_width = rtengine::max(w, 50); +} + +void MyProgressBar::get_preferred_width_for_height_vfunc (int width, int &minimum_width, int &natural_width) const +{ + get_preferred_width_vfunc (minimum_width, natural_width); +} BackBuffer::BackBuffer() : x(0), y(0), w(0), h(0), offset(0, 0), dirty(true) {} BackBuffer::BackBuffer(int width, int height, Cairo::Format format) : x(0), y(0), w(width), h(height), offset(0, 0), dirty(true) diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index ac81c27d5..d61c822c9 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -276,6 +276,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; @@ -283,6 +284,8 @@ class MyComboBox : public Gtk::ComboBox public: MyComboBox (); + + void setPreferredWidth (int minimum_width, int natural_width); }; /** @@ -290,6 +293,7 @@ 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; @@ -297,6 +301,8 @@ class MyComboBoxText : public Gtk::ComboBoxText public: MyComboBoxText (); + + void setPreferredWidth (int minimum_width, int natural_width); }; /** @@ -430,6 +436,22 @@ public: const Gtk::Label* getLabel () const; }; +class MyProgressBar : public Gtk::ProgressBar +{ +private: + int w; + + void get_preferred_width_vfunc (int &minimum_width, int &natural_width) const; + void get_preferred_width_for_height_vfunc (int width, int &minimum_width, int &natural_width) const; + +public: + MyProgressBar(int width); + MyProgressBar(); + + void setPreferredWidth(int width); +}; + + /** * @brief Define a gradient milestone */ diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index b3499dd11..c5b7993df 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -83,6 +83,7 @@ RTWindow::RTWindow () : mainNB(NULL) , bpanel(NULL) , splash(NULL) + , prProgBar(300) , btn_fullscreen(NULL) , epanel(NULL) , fpanel(NULL) @@ -267,21 +268,24 @@ RTWindow::RTWindow () prProgBar.set_show_text(true); Gtk::Grid* actionGrid = Gtk::manage (new Gtk::Grid ()); + actionGrid->set_row_spacing(2); + actionGrid->set_column_spacing(2); + setExpandAlignProperties(actionGrid, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); if (options.mainNBVertical) { - actionGrid->attach_next_to(*btn_fullscreen, Gtk::POS_BOTTOM, 1, 1); - actionGrid->attach_next_to(*preferences, *btn_fullscreen, Gtk::POS_TOP, 1, 1); - actionGrid->attach_next_to(prProgBar, *preferences, Gtk::POS_TOP, 1, 1); prProgBar.set_orientation(Gtk::ORIENTATION_VERTICAL); - //prProgBar.set_halign(Gtk::ALIGN_FILL); prProgBar.set_valign(Gtk::ALIGN_FILL); + actionGrid->set_orientation(Gtk::ORIENTATION_VERTICAL); + actionGrid->attach_next_to(prProgBar, Gtk::POS_BOTTOM, 1, 1); + actionGrid->attach_next_to(*preferences, Gtk::POS_BOTTOM, 1, 1); + actionGrid->attach_next_to(*btn_fullscreen, Gtk::POS_BOTTOM, 1, 1); mainNB->set_action_widget(actionGrid, Gtk::PACK_END); } else { - actionGrid->attach_next_to(*btn_fullscreen, Gtk::POS_RIGHT, 1, 1); - actionGrid->attach_next_to(*preferences, *btn_fullscreen, Gtk::POS_LEFT, 1, 1); - actionGrid->attach_next_to(prProgBar, *preferences, Gtk::POS_LEFT, 1, 1); prProgBar.set_orientation(Gtk::ORIENTATION_HORIZONTAL); - //prProgBar.set_halign(Gtk::ALIGN_FILL); prProgBar.set_valign(Gtk::ALIGN_FILL); + actionGrid->set_orientation(Gtk::ORIENTATION_HORIZONTAL); + actionGrid->attach_next_to(prProgBar, Gtk::POS_RIGHT, 1, 1); + actionGrid->attach_next_to(*preferences, Gtk::POS_RIGHT, 1, 1); + actionGrid->attach_next_to(*btn_fullscreen, Gtk::POS_RIGHT, 1, 1); mainNB->set_action_widget(actionGrid, Gtk::PACK_END); } diff --git a/rtgui/rtwindow.h b/rtgui/rtwindow.h index 5ea7a7946..d612c64e1 100644 --- a/rtgui/rtwindow.h +++ b/rtgui/rtwindow.h @@ -40,7 +40,7 @@ private: std::map epanels; Splash* splash; - Gtk::ProgressBar prProgBar; + MyProgressBar prProgBar; PLDBridge* pldBridge; bool is_fullscreen; bool on_delete_has_run; diff --git a/rtgui/zoompanel.cc b/rtgui/zoompanel.cc index f7cbe7470..0715b88cf 100644 --- a/rtgui/zoompanel.cc +++ b/rtgui/zoompanel.cc @@ -41,34 +41,51 @@ ZoomPanel::ZoomPanel (ImageArea* iarea) : iarea(iarea) zoomOut = Gtk::manage (new Gtk::Button()); zoomOut->add (*imageOut); zoomOut->set_relief(Gtk::RELIEF_NONE); + setExpandAlignProperties(zoomOut, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); zoomIn = Gtk::manage (new Gtk::Button()); zoomIn->add (*imageIn); zoomIn->set_relief(Gtk::RELIEF_NONE); + setExpandAlignProperties(zoomIn, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); zoomFit = Gtk::manage (new Gtk::Button()); zoomFit->add (*imageFit); zoomFit->set_relief(Gtk::RELIEF_NONE); + setExpandAlignProperties(zoomFit, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); zoomFitCrop = Gtk::manage (new Gtk::Button()); zoomFitCrop->add (*imageFitCrop); zoomFitCrop->set_relief(Gtk::RELIEF_NONE); + setExpandAlignProperties(zoomFitCrop, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); zoom11 = Gtk::manage (new Gtk::Button()); zoom11->add (*image11); zoom11->set_relief(Gtk::RELIEF_NONE); + setExpandAlignProperties(zoom11, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); - pack_start (*zoomOut, Gtk::PACK_SHRINK, 0); - pack_start (*zoomIn, Gtk::PACK_SHRINK, 0); - pack_start (*zoomFit, Gtk::PACK_SHRINK, 0); - pack_start (*zoomFitCrop, Gtk::PACK_SHRINK, 0); - pack_start (*zoom11, Gtk::PACK_SHRINK, 0); + attach_next_to (*zoomOut, Gtk::POS_RIGHT, 1, 1); + attach_next_to (*zoomIn, Gtk::POS_RIGHT, 1, 1); + attach_next_to (*zoomFit, Gtk::POS_RIGHT, 1, 1); + attach_next_to (*zoomFitCrop, Gtk::POS_RIGHT, 1, 1); + attach_next_to (*zoom11, Gtk::POS_RIGHT, 1, 1); + + /* + attach_next_to (*zoomOut, Gtk::POS_LEFT, 1, 1); + attach_next_to (*zoomIn, *zoomOut, Gtk::POS_RIGHT, 1, 1); + attach_next_to (*zoomFit, *zoomIn, Gtk::POS_RIGHT, 1, 1); + attach_next_to (*zoomFitCrop, *zoomFit, Gtk::POS_RIGHT, 1, 1); + attach_next_to (*zoom11, *zoomFitCrop, Gtk::POS_RIGHT, 1, 1); + */ zoomLabel = Gtk::manage (new Gtk::Label ()); - pack_start (*zoomLabel, Gtk::PACK_SHRINK, 4); + setExpandAlignProperties(zoomLabel, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); + attach_next_to (*zoomLabel, Gtk::POS_RIGHT, 1, 1); + //attach_next_to (*zoomLabel, *zoom11, Gtk::POS_RIGHT, 1, 1); Gtk::Image* imageCrop = Gtk::manage (new RTImage ("new-detail-window.png")); imageCrop->set_padding(0, 0); newCrop = Gtk::manage (new Gtk::Button()); newCrop->add (*imageCrop); newCrop->set_relief(Gtk::RELIEF_NONE); - pack_start (*newCrop, Gtk::PACK_SHRINK, 4); + setExpandAlignProperties(newCrop, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); + attach_next_to (*newCrop, Gtk::POS_RIGHT, 1, 1); + //attach_next_to (*newCrop, *zoomLabel, Gtk::POS_RIGHT, 1, 1); show_all_children (); diff --git a/rtgui/zoompanel.h b/rtgui/zoompanel.h index aa4d9177f..5528a4f42 100644 --- a/rtgui/zoompanel.h +++ b/rtgui/zoompanel.h @@ -22,7 +22,7 @@ #include class ImageArea; -class ZoomPanel : public Gtk::HBox +class ZoomPanel : public Gtk::Grid { protected: