summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-07-22 10:38:18 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-07-22 11:51:40 +0200
commit02c22a1f345ea61b5cac4981ca6fde4ede78774a (patch)
tree7d0d791c219b9ac5b8755e835a26509e2e604ecc
parentafd70f0490c6207ce8ce1e10897b84af0ca21bfd (diff)
gtktiledviewer: align to top/left for Calc
Otherwise when zooming out enough that not all available space is used, the default horizontal/vertical centering happens, and the row/column headers and the tiles become out of sync. Also revert to the previous default window size, I'm not sure why that was necessary. Currently checking the mentioned situation (empty Writer document with comments only) does not require this larger size, and testing two views is easier with the smaller size. Change-Id: Ia92a591387f62655a671e2d09f5053827fde5045 Reviewed-on: https://gerrit.libreoffice.org/27427 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 672b7411637f92acd30622ec2aaee840cbbbd0a9)
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 8da591bfcc58..5aeea199541d 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -1189,6 +1189,16 @@ static void openDocumentCallback (GObject* source_object, GAsyncResult* res, gpo
return;
}
+ LibreOfficeKitDocument* pDocument = lok_doc_view_get_document(pDocView);
+ if (pDocument && pDocument->pClass->getDocumentType(pDocument) == LOK_DOCTYPE_SPREADSHEET)
+ {
+ // Align to top left corner, so the tiles are in sync with the
+ // row/column bar, even when zooming out enough that not all space is
+ // used.
+ gtk_widget_set_halign(GTK_WIDGET(pDocView), GTK_ALIGN_START);
+ gtk_widget_set_valign(GTK_WIDGET(pDocView), GTK_ALIGN_START);
+ }
+
populatePartSelector(pDocView);
populatePartModeSelector( GTK_COMBO_BOX_TEXT(rWindow.m_pPartModeComboBox) );
registerSelectorHandlers(rWindow);
@@ -1205,7 +1215,7 @@ static GtkWidget* createWindow(TiledWindow& rWindow)
{
GtkWidget *pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(pWindow), "LibreOfficeKit GTK Tiled Viewer");
- gtk_window_set_default_size(GTK_WINDOW(pWindow), 1280, 720);
+ gtk_window_set_default_size(GTK_WINDOW(pWindow), 1024, 768);
g_signal_connect(pWindow, "destroy", G_CALLBACK(gtk_widget_destroy), pWindow);
rWindow.m_pVBox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);