diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-19 17:56:35 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-19 20:10:22 +0200 |
commit | 288013f25d2e52a76f7ce5368c505a6ccb3b64a2 (patch) | |
tree | 7f2ebea4554cd171b22577c38b8105df08191739 /libreofficekit | |
parent | aa51bf1e17dfb4a0a95a24e7de7f55d2b44b9472 (diff) |
sw: emit LOK_CALLBACK_STATE_CHANGED when cursor enters/leaves a redline
For now only care about the start of the cursor, which can be only at a
single redline.
Add matching testcase + expose it in the gtktiledviewer status bar for
interactive manual testing.
Change-Id: Ib61757412d6b54bef64361d4a8563795ca0bab6c
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx index 2576f9904ff7..385203d0dc42 100644 --- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx @@ -97,6 +97,7 @@ public: GtkWidget* m_pStatusBar; GtkWidget* m_pProgressBar; GtkWidget* m_pStatusbarLabel; + GtkWidget* m_pRedlineLabel; GtkWidget* m_pZoomLabel; GtkToolItem* m_pSaveButton; GtkToolItem* m_pCopyButton; @@ -145,6 +146,7 @@ public: m_pStatusBar(nullptr), m_pProgressBar(nullptr), m_pStatusbarLabel(nullptr), + m_pRedlineLabel(nullptr), m_pZoomLabel(nullptr), m_pSaveButton(nullptr), m_pCopyButton(nullptr), @@ -786,7 +788,7 @@ static void changeZoom( GtkWidget* pButton, gpointer /* pItem */ ) lok_doc_view_set_visible_area(LOK_DOC_VIEW(pDocView), &aVisibleArea); } } - std::string aZoom = std::to_string(int(fZoom * 100)) + std::string("%"); + std::string aZoom = std::string("Zoom: ") + std::to_string(int(fZoom * 100)) + std::string("%"); gtk_label_set_text(GTK_LABEL(rWindow.m_pZoomLabel), aZoom.c_str()); } @@ -1159,6 +1161,15 @@ static void signalCommand(LOKDocView* pLOKDocView, char* pPayload, gpointer /*pD rWindow.m_aToolItemSensitivities[pItem] = bSensitive; } } + else if (aKey == ".uno:TrackedChangeIndex") + { + std::string aText = std::string("Current redline: "); + if (aValue.empty()) + aText += "none"; + else + aText += aValue; + gtk_label_set_text(GTK_LABEL(rWindow.m_pRedlineLabel), aText.c_str()); + } } } @@ -1800,7 +1811,9 @@ static GtkWidget* createWindow(TiledWindow& rWindow) gtk_widget_set_hexpand(rWindow.m_pStatusbarLabel, TRUE); gtk_container_add(GTK_CONTAINER(pStatusBar), rWindow.m_pStatusbarLabel); - rWindow.m_pZoomLabel = gtk_label_new("100%"); + rWindow.m_pRedlineLabel = gtk_label_new("Current redline: none"); + gtk_container_add(GTK_CONTAINER(pStatusBar), rWindow.m_pRedlineLabel); + rWindow.m_pZoomLabel = gtk_label_new("Zoom: 100%"); gtk_container_add(GTK_CONTAINER(pStatusBar), rWindow.m_pZoomLabel); gtk_widget_show_all(pWindow); @@ -1813,6 +1826,7 @@ static GtkWidget* createWindow(TiledWindow& rWindow) gtk_widget_hide(rWindow.m_pFormulabarEntry); // Hide the non-progressbar children of the status bar by default. gtk_widget_hide(rWindow.m_pStatusbarLabel); + gtk_widget_hide(rWindow.m_pRedlineLabel); gtk_widget_hide(rWindow.m_pZoomLabel); g_aWindows[pWindow] = rWindow; |