summaryrefslogtreecommitdiff
path: root/libreofficekit
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 09:34:47 +0000
commit672b7411637f92acd30622ec2aaee840cbbbd0a9 (patch)
tree089682c98b0f1023e8428441429b866cc7b5b3d2 /libreofficekit
parentb949604b91f77dee3b2737ea09e1ac3ade4eed1c (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>
Diffstat (limited to 'libreofficekit')
-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 f80b506a0432..58139a53c50d 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);