[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: koffice
From: Sebastian Sauer <mail () dipe ! org>
Date: 2007-12-03 21:57:05
Message-ID: 1196719025.909197.21216.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 744586 by sebsauer:
Added KoMainWindow::viewFullscreen(bool) to be able to switch between fullscreen and \
normal modes.
The method does not more then calling showFullScreen()/showNormal() atm but could be \
later extended to e.g. hide dockers at fullscreen. IMHO it would make sense to \
introduce a way to differ between different modes and there view-settings to be able \
to say that e.g. in fullscreen-mode only docker "xyz" should be displayed while in \
normal-mode others should be displayed. Anyway, that's todo for later :) To add it to \
your ko-app, just put a <Action name="view_fullscreen"/> into your apps *.rc file and \
in the view do something like actioncollection->addAction("view_fullscreen", \
view->shell()->actionCollection()->action("view_fullscreen"));
M +0 -16 kspread/dialogs/LayoutDialog.cpp
M +0 -2 kspread/dialogs/LayoutDialog.h
M +0 -8 kspread/dialogs/LinkDialog.cpp
M +1 -0 kspread/dialogs/PreferenceDialog.cpp
M +0 -2 kspread/dialogs/SeriesDialog.cpp
M +0 -2 kspread/dialogs/SeriesDialog.h
M +1 -0 kspread/kspread.rc
M +2 -0 kspread/ui/View.cpp
M +23 -7 libs/main/KoMainWindow.cpp
M +5 -0 libs/main/KoMainWindow.h
--- trunk/koffice/kspread/dialogs/LayoutDialog.cpp #744585:744586
@@ -318,8 +318,6 @@
*
***************************************************************************/
-QString CellFormatDialog::m_lastpage;
-
CellFormatDialog::CellFormatDialog( View * _view, Sheet * _sheet )
: KPageDialog(_view),
m_doc( _sheet->doc() ),
@@ -600,8 +598,6 @@
CellFormatDialog::~CellFormatDialog()
{
- if ( KPageWidgetItem* item = currentPage() )
- m_lastpage = item->name();
delete formatOnlyNegSignedPixmap;
delete formatRedOnlyNegSignedPixmap;
delete formatRedNeverSignedPixmap;
@@ -793,36 +789,24 @@
floatPage = new CellFormatPageFloat( this, this );
KPageWidgetItem* formatitem = addPage( floatPage, i18n("&Data Format") );
- if ( formatitem->name() == m_lastpage )
- setCurrentPage( formatitem );
fontPage = new CellFormatPageFont( this, this );
KPageWidgetItem* fontitem = addPage( fontPage, i18n("&Font") );
- if ( fontitem->name() == m_lastpage )
- setCurrentPage( fontitem );
// miscPage = new CellFormatPageMisc( tab, this );
// tab->addTab( miscPage, i18n("&Misc") );
positionPage = new CellFormatPagePosition( this, this);
KPageWidgetItem* positem = addPage( positionPage, i18n("&Position") );
- if ( positem->name() == m_lastpage )
- setCurrentPage( positem );
borderPage = new CellFormatPageBorder( this, this );
KPageWidgetItem* borderitem = addPage( borderPage, i18n("&Border") );
- if ( borderitem->name() == m_lastpage )
- setCurrentPage( borderitem );
patternPage=new CellFormatPagePattern(this,this);
KPageWidgetItem* backgrounditem = addPage( patternPage,i18n("Back&ground") );
- if ( backgrounditem->name() == m_lastpage )
- setCurrentPage( backgrounditem );
protectPage = new CellFormatPageProtection( this, this );
KPageWidgetItem* protectitem = addPage( protectPage, i18n("&Cell Protection") );
- if ( protectitem->name() == m_lastpage )
- setCurrentPage( protectitem );
connect( this, SIGNAL( okClicked() ), this, SLOT( slotApply() ) );
}
--- trunk/koffice/kspread/dialogs/LayoutDialog.h #744585:744586
@@ -626,8 +626,6 @@
CustomStyle * m_style;
StyleManager * m_styleManager;
- static QString m_lastpage;
-
void applyStyle();
};
--- trunk/koffice/kspread/dialogs/LinkDialog.cpp #744585:744586
@@ -83,8 +83,6 @@
d->p1->setHeader( i18n("Link to Internet Address") );
d->p1->setIcon( KIcon("network") );
QVBoxLayout* iLayout = new QVBoxLayout( d->internetPage );
- iLayout->setMargin( marginHint() );
- iLayout->setSpacing( spacingHint() );
iLayout->addWidget( new QLabel( i18n("Text to display:" ), d->internetPage ) );
d->internetText = new KLineEdit( d->internetPage );
iLayout->addWidget( d->internetText );
@@ -101,8 +99,6 @@
d->p2->setHeader( i18n("Link to Mail Address") );
d->p2->setIcon( KIcon("mail") );
QVBoxLayout* mLayout = new QVBoxLayout( d->mailPage );
- mLayout->setMargin( marginHint() );
- mLayout->setSpacing( spacingHint() );
mLayout->addWidget( new QLabel( i18n("Text to display:" ), d->mailPage ) );
d->mailText = new KLineEdit( d->mailPage );
mLayout->addWidget( d->mailText );
@@ -122,8 +118,6 @@
d->p3->setHeader( i18n("Link to File") );
d->p3->setIcon( KIcon("document-open") );
QVBoxLayout* fLayout = new QVBoxLayout( d->filePage );
- fLayout->setMargin( marginHint() );
- fLayout->setSpacing( spacingHint() );
fLayout->addWidget( new QLabel( i18n("Text to display:" ), d->filePage ) );
d->fileText = new KLineEdit( d->filePage );
fLayout->addWidget( d->fileText );
@@ -163,8 +157,6 @@
d->p4->setHeader( i18n("Link to Cell") );
d->p4->setIcon( KIcon("table") );
QVBoxLayout* cLayout = new QVBoxLayout( d->cellPage );
- cLayout->setMargin( marginHint() );
- cLayout->setSpacing( spacingHint() );
cLayout->addWidget( new QLabel( i18n("Text to display:" ), d->cellPage ) );
d->cellText = new KLineEdit( d->cellPage );
cLayout->addWidget( d->cellText );
--- trunk/koffice/kspread/dialogs/PreferenceDialog.cpp #744585:744586
@@ -781,6 +781,7 @@
QWidget* tmpQGroupBox = new QWidget( box );
QGridLayout *grid1 = new QGridLayout(tmpQGroupBox);
+ grid1->setMargin(0);
// grid1->addItem(new QSpacerItem( 0, KDialog::marginHint() ), 0, 0 );
grid1->setRowStretch( 7, 10 );
--- trunk/koffice/kspread/dialogs/SeriesDialog.cpp #744585:744586
@@ -122,8 +122,6 @@
grid1->addWidget(gb2);
start->setFocus();
-
- //connect( this, SIGNAL( okClicked() ), this, SLOT( slotOk() ) );
}
void SeriesDlg::slotButtonClicked(int button)
--- trunk/koffice/kspread/dialogs/SeriesDialog.h #744585:744586
@@ -46,8 +46,6 @@
Sheet* sheet;
public slots:
- //void slotOk();
-
virtual void slotButtonClicked(int button);
protected:
--- trunk/koffice/kspread/kspread.rc #744585:744586
@@ -56,6 +56,7 @@
<Action name="showCommentIndicator"/>
<Separator/>
<Action name="view_zoom"/>
+ <Action name="view_fullscreen"/>
<!-- <Separator/>
<Action name="inspector"/>-->
</Menu>
--- trunk/koffice/kspread/ui/View.cpp #744585:744586
@@ -532,6 +532,8 @@
KActionCollection* ac = view->actionCollection();
+ ac->addAction("view_fullscreen", \
view->shell()->actionCollection()->action("view_fullscreen")); +
// -- cell formatting actions --
actions->cellLayout = new KAction(KIcon( "cell_layout" ), i18n("Cell Format..."), \
view);
--- trunk/koffice/libs/main/KoMainWindow.cpp #744585:744586
@@ -178,9 +178,9 @@
QByteArray m_lastExportFormat;
int m_lastExportSpecialOutputFlag;
- QMap<QString, QDockWidget*> m_dockWidgetMap;
- KActionMenu* m_dockWidgetMenu;
- QMap<QDockWidget*, bool> m_dockWidgetVisibilityMap;
+ QMap<QString, QDockWidget*> m_dockWidgetMap;
+ KActionMenu* m_dockWidgetMenu;
+ QMap<QDockWidget*, bool> m_dockWidgetVisibilityMap;
};
KoMainWindow::KoMainWindow( const KComponentData &componentData )
@@ -279,6 +279,11 @@
d->m_splitViewActionList.append(d->m_removeView);
d->m_removeView->setEnabled(false);
+ KToggleAction *fullscreenAction = new KToggleAction(KIcon("view-fullscreen"), \
i18n("Full Screen Mode"), this); + \
actionCollection()->addAction("view_fullscreen", fullscreenAction); + \
fullscreenAction->setShortcut(QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_F )); + \
connect(fullscreenAction, SIGNAL(toggled(bool)), this, SLOT(viewFullscreen(bool))); +
d->m_orientation = new KSelectAction(KIcon("view_orientation"), i18n("Splitter \
&Orientation"), this);
actionCollection()->addAction("view_splitter_orientation", d->m_orientation );
connect( d->m_orientation, SIGNAL(triggered(bool)), this, \
SLOT(slotSetOrientation()) ); @@ -428,11 +433,11 @@
delete oldRootDoc;
}
- if(doc && !d->m_dockWidgetVisibilityMap.isEmpty()) {
- foreach( QDockWidget* dockWidget, d->m_dockWidgetMap.values() ) {
- dockWidget->setVisible( d->m_dockWidgetVisibilityMap.value(dockWidget) \
);
- }
+ if(doc && !d->m_dockWidgetVisibilityMap.isEmpty()) {
+ foreach( QDockWidget* dockWidget, d->m_dockWidgetMap.values() ) {
+ dockWidget->setVisible( d->m_dockWidgetVisibilityMap.value(dockWidget) );
}
+ }
}
void KoMainWindow::updateReloadFileAction(KoDocument *doc)
@@ -1479,6 +1484,17 @@
d->m_splitted=false;
}
+void KoMainWindow::viewFullscreen(bool fullScreen)
+{
+ //TODO optional hide toolbars, statusbar, dockers, etc. Probably introduce own \
'view modes' with there own kconfig-settings + if(fullScreen) {
+ showFullScreen();
+ }
+ else {
+ showNormal();
+ }
+}
+
void KoMainWindow::slotSetOrientation() {
d->m_splitter->setOrientation(static_cast<Qt::Orientation>
(d->m_orientation->currentItem()));
--- trunk/koffice/libs/main/KoMainWindow.h #744585:744586
@@ -281,6 +281,11 @@
virtual void slotCloseAllViews();
/**
+ * Toggle full screen on/off.
+ */
+ virtual void viewFullscreen(bool fullScreen);
+
+ /**
* Reload file
*/
void slotReloadFile();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic