diff --git a/src/gui/Layout.cpp b/src/gui/Layout.cpp index eb30c1d0..a8741a2f 100644 --- a/src/gui/Layout.cpp +++ b/src/gui/Layout.cpp @@ -168,7 +168,8 @@ void Layout::layoutPages(int width, int height) { recalculate_int(); } // Todo: remove, just a hack-hotfix - scrollHandling->setLayoutSize(width, height); + scrollHandling->setLayoutSize(std::max(width, int(unsigned(this->pc.minWidth))), + std::max(height, int(unsigned(this->pc.minHeight)))); size_t const len = this->view->viewPages.size(); Settings* settings = this->view->getControl()->getSettings(); diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 04d8d499..3e03ee08 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -243,23 +243,19 @@ void MainWindow::initXournalWidget() { usingTouchWorkaround = control->getSettings()->isTouchWorkaround(); if (usingTouchWorkaround) { - GtkWidget* box1 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); - gtk_container_add(GTK_CONTAINER(boxContents), box1); - - GtkWidget* box2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); - gtk_container_add(GTK_CONTAINER(box1), box2); - + GtkWidget* grid = gtk_grid_new(); + gtk_container_add(GTK_CONTAINER(boxContents), grid); this->scrollHandling = new ScrollHandlingXournalpp(); - this->xournal = new XournalView(box2, control, scrollHandling); - - gtk_container_add(GTK_CONTAINER(box2), - gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, scrollHandling->getVertical())); - gtk_container_add(GTK_CONTAINER(box1), - gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, scrollHandling->getHorizontal())); + this->xournal = new XournalView(grid, control, scrollHandling); - control->getZoomControl()->initZoomHandler(this->window, box2, xournal, control); - gtk_widget_show_all(box1); + gtk_grid_attach(GTK_GRID(grid), gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, scrollHandling->getVertical()), // + 1, 0, 1, 1); + gtk_grid_attach(GTK_GRID(grid), + gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, scrollHandling->getHorizontal()), // + 0, 1, 1, 1); + control->getZoomControl()->initZoomHandler(this->window, grid, xournal, control); + gtk_widget_show_all(grid); } else { winXournal = gtk_scrolled_window_new(nullptr, nullptr); diff --git a/src/gui/widgets/XournalWidget.cpp b/src/gui/widgets/XournalWidget.cpp index f0150d37..169e15ea 100644 --- a/src/gui/widgets/XournalWidget.cpp +++ b/src/gui/widgets/XournalWidget.cpp @@ -163,12 +163,14 @@ static void gtk_xournal_init(GtkXournal* xournal) { static void gtk_xournal_get_preferred_width(GtkWidget* widget, gint* minimal_width, gint* natural_width) { GtkXournal* xournal = GTK_XOURNAL(widget); - *minimal_width = *natural_width = xournal->layout->getMinimalWidth(); + *minimal_width = 20; + *natural_width = xournal->layout->getMinimalWidth(); } static void gtk_xournal_get_preferred_height(GtkWidget* widget, gint* minimal_height, gint* natural_height) { GtkXournal* xournal = GTK_XOURNAL(widget); - *minimal_height = *natural_height = xournal->layout->getMinimalHeight(); + *minimal_height = 20; + *natural_height = xournal->layout->getMinimalHeight(); } /**