In MEOW mode size of toolpanel has to depend on size of MEOW window instead on size of main rt window

This commit is contained in:
heckflosse
2017-07-07 21:00:31 +02:00
parent c30683f5f6
commit aecfaa2631
4 changed files with 14 additions and 3 deletions

View File

@@ -453,7 +453,7 @@ public:
};
EditorPanel::EditorPanel (FilePanel* filePanel)
: catalogPane(nullptr), realized(false), tbBeforeLock(nullptr), iHistoryShow(nullptr), iHistoryHide(nullptr), iTopPanel_1_Show(nullptr), iTopPanel_1_Hide(nullptr), iRightPanel_1_Show(nullptr), iRightPanel_1_Hide(nullptr), iBeforeLockON(nullptr), iBeforeLockOFF(nullptr), previewHandler(nullptr), beforePreviewHandler(nullptr), beforeIarea(nullptr), beforeBox(nullptr), afterBox(nullptr), beforeLabel(nullptr), afterLabel(nullptr), beforeHeaderBox(nullptr), afterHeaderBox(nullptr), parent(nullptr), openThm(nullptr), isrc(nullptr), ipc(nullptr), beforeIpc(nullptr), err(0), isProcessing(false)
: catalogPane(nullptr), realized(false), tbBeforeLock(nullptr), iHistoryShow(nullptr), iHistoryHide(nullptr), iTopPanel_1_Show(nullptr), iTopPanel_1_Hide(nullptr), iRightPanel_1_Show(nullptr), iRightPanel_1_Hide(nullptr), iBeforeLockON(nullptr), iBeforeLockOFF(nullptr), previewHandler(nullptr), beforePreviewHandler(nullptr), beforeIarea(nullptr), beforeBox(nullptr), afterBox(nullptr), beforeLabel(nullptr), afterLabel(nullptr), beforeHeaderBox(nullptr), afterHeaderBox(nullptr), parent(nullptr), parentWindow(nullptr), openThm(nullptr), isrc(nullptr), ipc(nullptr), beforeIpc(nullptr), err(0), isProcessing(false)
{
epih = new EditorPanelIdleHelper;
@@ -899,7 +899,7 @@ void EditorPanel::rightPaneButtonReleased (GdkEventButton *event)
{
if (event->button == 1) {
int winW, winH;
parent->get_size (winW, winH);
parentWindow->get_size (winW, winH);
// Button 1 released : it's a resize
options.toolPanelWidth = winW - hpanedr->get_position();
}
@@ -929,7 +929,7 @@ void EditorPanel::showTopPanel (bool show)
void EditorPanel::setAspect ()
{
int winW, winH;
parent->get_size (winW, winH);
parentWindow->get_size (winW, winH);
hpanedl->set_position (options.historyPanelWidth);
hpanedr->set_position (winW - options.toolPanelWidth);

View File

@@ -67,6 +67,12 @@ public:
{
parent = p;
}
void setParentWindow (Gtk::Window* p)
{
parentWindow = p;
}
void writeOptions();
void showTopPanel (bool show);
@@ -196,6 +202,7 @@ private:
HistogramPanel* histogramPanel;
ToolPanelCoordinator* tpc;
RTWindow* parent;
Gtk::Window* parentWindow;
//SaveAsDialog* saveAsDialog;
FilePanel* fPanel;

View File

@@ -124,6 +124,7 @@ void EditWindow::on_mainNB_switch_page(Gtk::Widget* widget, guint page_num)
void EditWindow::addEditorPanel (EditorPanel* ep, const std::string &name)
{
ep->setParent (parent);
ep->setParentWindow(this);
// construct closeable tab for the image
Gtk::HBox* hb = Gtk::manage (new Gtk::HBox ());

View File

@@ -146,6 +146,7 @@ RTWindow::RTWindow ()
if(simpleEditor) {
epanel = Gtk::manage( new EditorPanel (nullptr) );
epanel->setParent (this);
epanel->setParentWindow(this);
add (*epanel);
show_all ();
@@ -387,6 +388,7 @@ void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name)
wndEdit->addEditorPanel(ep, name);
} else {
ep->setParent (this);
ep->setParentWindow(this);
// construct closeable tab for the image
Gtk::Grid* titleGrid = Gtk::manage (new Gtk::Grid ());
@@ -868,6 +870,7 @@ void RTWindow::createSetmEditor()
// Editor panel, single-tab mode only
epanel = Gtk::manage ( new EditorPanel (fpanel) );
epanel->setParent (this);
epanel->setParentWindow(this);
// decorate tab
Gtk::Grid* const editorLabelGrid = Gtk::manage (new Gtk::Grid ());