Re: some bugs
"Ilya Konkov" <[email protected]>
| Newsgroups | gmane.comp.kde.gwenview |
|---|---|
| Message-ID | <[email protected]> |
Hello. > I remember fixing such a bug shortly before KDE4.0 got released. I looked into the source and found that your fix is not applied to wheelEvent and keyPressEvent. Found solution for the bug without reimplementing those functions. I'm also attaching show/hide menubar patch, probably it will be useful. -- Ilya Konkov ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Gwenview-general mailing list Gwenview-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/gwenview-general
scrollbars.patch
(text/x-patch, 465 B)
Index: imageview.cpp
===================================================================
--- imageview.cpp (revision 762665)
+++ imageview.cpp (working copy)
@@ -350,6 +350,8 @@
if (d->mZoomToFit) {
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ horizontalScrollBar()->setRange(0, 0);
+ verticalScrollBar()->setRange(0, 0);
return;
}
setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
hide-menubar.patch
(text/x-patch, 2.6 KB)
Index: app/gwenviewui.rc
===================================================================
--- app/gwenviewui.rc (revision 762458)
+++ app/gwenviewui.rc (working copy)
@@ -40,6 +40,8 @@
</Menu>
<Menu name="settings" noMerge="1">
<text>&Settings</text>
+ <Action name="toggle_menubar"/>
+ <Separator/>
<!--
Disable merging because we don't want the "fullscreen" action to appear
here, since it's already in the "view" menu.
Index: app/mainwindow.h
===================================================================
--- app/mainwindow.h (revision 762458)
+++ app/mainwindow.h (working copy)
@@ -127,6 +127,9 @@
void configureToolbars();
void slotNewToolbarConfig();
+
+ void toggleMenuBar();
+ void updateMenuBarAction();
private:
class Private;
Index: app/mainwindow.cpp
===================================================================
--- app/mainwindow.cpp (revision 762458)
+++ app/mainwindow.cpp (working copy)
@@ -155,6 +155,7 @@
QAction* mToggleSideBarAction;
KToggleFullScreenAction* mFullScreenAction;
QAction* mToggleSlideShowAction;
+ QAction* mToggleMenuBarAction;
SortedDirModel* mDirModel;
ContextManager* mContextManager;
@@ -348,6 +349,14 @@
mWindow, SLOT(toggleSlideShow()) );
connect(mSlideShow, SIGNAL(stateChanged(bool)),
mWindow, SLOT(updateSlideShowAction()) );
+
+ mToggleMenuBarAction = actionCollection->addAction("toggle_menubar");
+ mToggleMenuBarAction->setIcon(KIcon("show-menu"));
+ mToggleMenuBarAction->setShortcut(Qt::CTRL + Qt::Key_M);
+ mToggleMenuBarAction->setCheckable(true);
+ mWindow->updateMenuBarAction();
+ connect(mToggleMenuBarAction, SIGNAL(triggered()),
+ mWindow, SLOT(toggleMenuBar()) );
KStandardAction::keyBindings(mWindow->guiFactory(),
SLOT(configureShortcuts()), actionCollection);
@@ -946,7 +955,7 @@
d->mSaveBar->setForceHide(false);
d->mFullScreenBar->setActivated(false);
setWindowState(d->mStateBeforeFullScreen.mWindowState);
- menuBar()->show();
+ menuBar()->setVisible(!d->mToggleMenuBarAction->isChecked());
toolBar()->show();
}
setUpdatesEnabled(true);
@@ -1213,6 +1222,23 @@
}
+void MainWindow::toggleMenuBar() {
+ if (!d->mFullScreenAction->isChecked()) {
+ menuBar()->setVisible(!d->mToggleMenuBarAction->isChecked());
+ updateMenuBarAction();
+ }
+}
+
+
+void MainWindow::updateMenuBarAction() {
+ if (d->mToggleMenuBarAction->isChecked()) {
+ d->mToggleMenuBarAction->setText(i18n("Show Menubar"));
+ } else {
+ d->mToggleMenuBarAction->setText(i18n("Hide Menubar"));
+ }
+}
+
+
void MainWindow::loadConfig() {
QColor bgColor = GwenviewConfig::viewBackgroundColor();
QColor fgColor = bgColor.value() > 128 ? Qt::black : Qt::white;