Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
901fa421
Kaydet (Commit)
901fa421
authored
Kas 02, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
gtktiledviewer: show zoom in the status bar
Change-Id: I4ab00a269b0a8435a278f93e1d92d102a80c8506
üst
97a392a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
7 deletions
+27
-7
gtktiledviewer.cxx
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+27
-7
No files found.
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
Dosyayı görüntüle @
901fa421
...
@@ -83,6 +83,9 @@ class TiledWindow
...
@@ -83,6 +83,9 @@ class TiledWindow
public
:
public
:
GtkWidget
*
m_pDocView
;
GtkWidget
*
m_pDocView
;
GtkWidget
*
m_pStatusBar
;
GtkWidget
*
m_pStatusBar
;
GtkWidget
*
m_pProgressBar
;
GtkWidget
*
m_pStatusbarLabel
;
GtkWidget
*
m_pZoomLabel
;
GtkToolItem
*
m_pEnableEditing
;
GtkToolItem
*
m_pEnableEditing
;
GtkToolItem
*
m_pBold
;
GtkToolItem
*
m_pBold
;
GtkToolItem
*
m_pItalic
;
GtkToolItem
*
m_pItalic
;
...
@@ -114,6 +117,9 @@ public:
...
@@ -114,6 +117,9 @@ public:
TiledWindow
()
TiledWindow
()
:
m_pDocView
(
0
),
:
m_pDocView
(
0
),
m_pStatusBar
(
0
),
m_pStatusBar
(
0
),
m_pProgressBar
(
0
),
m_pStatusbarLabel
(
0
),
m_pZoomLabel
(
0
),
m_pEnableEditing
(
0
),
m_pEnableEditing
(
0
),
m_pBold
(
0
),
m_pBold
(
0
),
m_pItalic
(
0
),
m_pItalic
(
0
),
...
@@ -373,6 +379,8 @@ static void changeZoom( GtkWidget* pButton, gpointer /* pItem */ )
...
@@ -373,6 +379,8 @@ static void changeZoom( GtkWidget* pButton, gpointer /* pItem */ )
lok_doc_view_set_zoom
(
LOK_DOC_VIEW
(
pDocView
),
fZoom
);
lok_doc_view_set_zoom
(
LOK_DOC_VIEW
(
pDocView
),
fZoom
);
}
}
}
}
std
::
string
aZoom
=
std
::
to_string
(
int
(
fZoom
*
100
))
+
std
::
string
(
"%"
);
gtk_label_set_text
(
GTK_LABEL
(
rWindow
.
m_pZoomLabel
),
aZoom
.
c_str
());
}
}
/// User clicked on the button -> inform LOKDocView.
/// User clicked on the button -> inform LOKDocView.
...
@@ -425,8 +433,9 @@ static void createView(GtkWidget* pButton, gpointer /*pItem*/)
...
@@ -425,8 +433,9 @@ static void createView(GtkWidget* pButton, gpointer /*pItem*/)
GtkWidget
*
pDocView
=
lok_doc_view_new_from_widget
(
LOK_DOC_VIEW
(
rWindow
.
m_pDocView
));
GtkWidget
*
pDocView
=
lok_doc_view_new_from_widget
(
LOK_DOC_VIEW
(
rWindow
.
m_pDocView
));
TiledWindow
&
rNewWindow
=
setupWidgetAndCreateWindow
(
pDocView
);
TiledWindow
&
rNewWindow
=
setupWidgetAndCreateWindow
(
pDocView
);
// Hide status bar that contains the unused progress bar.
// Hide the unused progress bar.
gtk_widget_hide
(
rNewWindow
.
m_pStatusBar
);
gtk_widget_show_all
(
rNewWindow
.
m_pStatusBar
);
gtk_widget_hide
(
rNewWindow
.
m_pProgressBar
);
}
}
/// Creates a new model, i.e. LOK init and document load, one view implicitly.
/// Creates a new model, i.e. LOK init and document load, one view implicitly.
...
@@ -846,7 +855,8 @@ static void openDocumentCallback (GObject* source_object, GAsyncResult* res, gpo
...
@@ -846,7 +855,8 @@ static void openDocumentCallback (GObject* source_object, GAsyncResult* res, gpo
focusChain
=
g_list_append
(
focusChain
,
pDocView
);
focusChain
=
g_list_append
(
focusChain
,
pDocView
);
gtk_container_set_focus_chain
(
GTK_CONTAINER
(
rWindow
.
m_pVBox
),
focusChain
);
gtk_container_set_focus_chain
(
GTK_CONTAINER
(
rWindow
.
m_pVBox
),
focusChain
);
gtk_widget_hide
(
rWindow
.
m_pStatusBar
);
gtk_widget_show_all
(
rWindow
.
m_pStatusBar
);
gtk_widget_hide
(
rWindow
.
m_pProgressBar
);
}
}
/// Creates the GtkWindow that has main widget as children and registers it in the window map.
/// Creates the GtkWindow that has main widget as children and registers it in the window map.
...
@@ -1086,15 +1096,22 @@ static GtkWidget* createWindow(TiledWindow& rWindow)
...
@@ -1086,15 +1096,22 @@ static GtkWidget* createWindow(TiledWindow& rWindow)
gtk_container_add
(
GTK_CONTAINER
(
rWindow
.
m_pScrolledWindow
),
rWindow
.
m_pDocView
);
gtk_container_add
(
GTK_CONTAINER
(
rWindow
.
m_pScrolledWindow
),
rWindow
.
m_pDocView
);
GtkWidget
*
pProgressBar
=
gtk_progress_bar_new
();
rWindow
.
m_
pProgressBar
=
gtk_progress_bar_new
();
g_signal_connect
(
rWindow
.
m_pDocView
,
"load-changed"
,
G_CALLBACK
(
loadChanged
),
pProgressBar
);
g_signal_connect
(
rWindow
.
m_pDocView
,
"load-changed"
,
G_CALLBACK
(
loadChanged
),
rWindow
.
m_
pProgressBar
);
GtkWidget
*
pStatusBar
=
gtk_statusbar_new
();
GtkWidget
*
pStatusBar
=
gtk_statusbar_new
();
rWindow
.
m_pStatusBar
=
pStatusBar
;
rWindow
.
m_pStatusBar
=
pStatusBar
;
gtk_container_forall
(
GTK_CONTAINER
(
pStatusBar
),
removeChildrenFromStatusbar
,
pStatusBar
);
gtk_container_forall
(
GTK_CONTAINER
(
pStatusBar
),
removeChildrenFromStatusbar
,
pStatusBar
);
gtk_container_add
(
GTK_CONTAINER
(
rWindow
.
m_pVBox
),
pStatusBar
);
gtk_container_add
(
GTK_CONTAINER
(
rWindow
.
m_pVBox
),
pStatusBar
);
gtk_container_add
(
GTK_CONTAINER
(
pStatusBar
),
pProgressBar
);
gtk_container_add
(
GTK_CONTAINER
(
pStatusBar
),
rWindow
.
m_pProgressBar
);
gtk_widget_set_hexpand
(
pProgressBar
,
true
);
gtk_widget_set_hexpand
(
rWindow
.
m_pProgressBar
,
true
);
rWindow
.
m_pStatusbarLabel
=
gtk_label_new
(
""
);
gtk_widget_set_hexpand
(
rWindow
.
m_pStatusbarLabel
,
TRUE
);
gtk_container_add
(
GTK_CONTAINER
(
pStatusBar
),
rWindow
.
m_pStatusbarLabel
);
rWindow
.
m_pZoomLabel
=
gtk_label_new
(
"100%"
);
gtk_container_add
(
GTK_CONTAINER
(
pStatusBar
),
rWindow
.
m_pZoomLabel
);
gtk_widget_show_all
(
pWindow
);
gtk_widget_show_all
(
pWindow
);
// Hide the findbar by default.
// Hide the findbar by default.
...
@@ -1103,6 +1120,9 @@ static GtkWidget* createWindow(TiledWindow& rWindow)
...
@@ -1103,6 +1120,9 @@ static GtkWidget* createWindow(TiledWindow& rWindow)
gtk_widget_hide
(
rWindow
.
m_pCornerButton
->
m_pDrawingArea
);
gtk_widget_hide
(
rWindow
.
m_pCornerButton
->
m_pDrawingArea
);
gtk_widget_hide
(
rWindow
.
m_pRowBar
->
m_pDrawingArea
);
gtk_widget_hide
(
rWindow
.
m_pRowBar
->
m_pDrawingArea
);
gtk_widget_hide
(
rWindow
.
m_pColumnBar
->
m_pDrawingArea
);
gtk_widget_hide
(
rWindow
.
m_pColumnBar
->
m_pDrawingArea
);
// Hide the non-progressbar children of the status bar by default.
gtk_widget_hide
(
rWindow
.
m_pStatusbarLabel
);
gtk_widget_hide
(
rWindow
.
m_pZoomLabel
);
g_aWindows
[
pWindow
]
=
rWindow
;
g_aWindows
[
pWindow
]
=
rWindow
;
g_signal_connect
(
rWindow
.
m_pDocView
,
"configure-event"
,
G_CALLBACK
(
TiledRowColumnBar
::
docConfigureEvent
),
0
);
g_signal_connect
(
rWindow
.
m_pDocView
,
"configure-event"
,
G_CALLBACK
(
TiledRowColumnBar
::
docConfigureEvent
),
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment