mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-25 10:55:37 +00:00
Add menu to exit to "fullscreen" but it doesn't work
because "m_part is a "KParts::ReadOnlyPart*" and not a kpdf_part and I don't know how to create it. I need help from a people who knows kpart please. Regards (see kpdf_shell.cpp) svn path=/trunk/kdegraphics/kpdf/; revision=251221
This commit is contained in:
parent
9220ef7f35
commit
10f5a7bb56
|
@ -46,6 +46,10 @@ namespace KPDF
|
|||
{
|
||||
if (m_doc == 0)
|
||||
return;
|
||||
if ( e->button() & RightButton )
|
||||
{
|
||||
emit rightClick();
|
||||
}
|
||||
|
||||
m_pressedAction = m_doc->findLink(e->x()/m_ppp, e->y()/m_ppp);
|
||||
}
|
||||
|
|
|
@ -57,6 +57,8 @@ namespace KPDF
|
|||
void ReadDown();
|
||||
void ZoomOut();
|
||||
void ZoomIn();
|
||||
void rightClick();
|
||||
|
||||
protected:
|
||||
virtual void keyPressEvent( QKeyEvent* );
|
||||
void contentsMousePressEvent(QMouseEvent*);
|
||||
|
|
|
@ -71,6 +71,8 @@ namespace KPDF
|
|||
void displayDestination(LinkDest*);
|
||||
void updateActionPage();
|
||||
void setFullScreen( bool fs );
|
||||
PageWidget* pageWidget() const {return m_outputDev;}
|
||||
|
||||
protected:
|
||||
/**
|
||||
* This must be implemented by each part
|
||||
|
|
|
@ -21,7 +21,9 @@
|
|||
#include <klocale.h>
|
||||
#include <kmainwindow.h>
|
||||
#include <kmenubar.h>
|
||||
#include <kpopupmenu.h>
|
||||
#include <kparts/componentfactory.h>
|
||||
#include <qcursor.h>
|
||||
|
||||
using namespace KPDF;
|
||||
|
||||
|
@ -63,6 +65,8 @@ Shell::Shell()
|
|||
// next time we enter the event loop...
|
||||
return;
|
||||
}
|
||||
//FIXME m_part is not a KPART::readon... it's a kdpf_part...
|
||||
//connect( m_part->pageWidget(), SIGNAL( rightClick() ),SLOT( slotRMBClick() ) );
|
||||
|
||||
readSettings();
|
||||
}
|
||||
|
@ -128,6 +132,9 @@ Shell::setupActions()
|
|||
#else
|
||||
m_fullScreenAction = new KToggleAction( this, SLOT( slotToggleFullScreen() ) );
|
||||
#endif
|
||||
m_popup = new KPopupMenu( this, "rmb popup" );
|
||||
m_popup->insertTitle( i18n( "Full Screen Options" ) );
|
||||
m_fullScreenAction->plug( m_popup );
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -236,5 +243,10 @@ void Shell::setFullScreen( bool useFullScreen )
|
|||
}
|
||||
}
|
||||
|
||||
void Shell::slotRMBClick()
|
||||
{
|
||||
m_popup->exec( QCursor::pos() );
|
||||
}
|
||||
|
||||
|
||||
// vim:ts=2:sw=2:tw=78:et
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <kapplication.h>
|
||||
#include <kparts/mainwindow.h>
|
||||
class KPopupMenu;
|
||||
|
||||
|
||||
namespace KPDF
|
||||
|
@ -62,6 +63,8 @@ namespace KPDF
|
|||
|
||||
void applyNewToolbarConfig();
|
||||
void slotToggleFullScreen();
|
||||
void slotRMBClick();
|
||||
|
||||
public slots:
|
||||
void openURL( const KURL & url );
|
||||
|
||||
|
@ -74,6 +77,7 @@ namespace KPDF
|
|||
KRecentFilesAction* recent;
|
||||
KToggleAction* m_fullScreenAction;
|
||||
bool m_isFullScreen;
|
||||
KPopupMenu* m_popup;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue