|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2003 by Roberto Raggi *
|
|
|
|
* roberto@kdevelop.org *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#include <kiconloader.h>
|
|
|
|
#include <tdelocale.h>
|
|
|
|
#include <tdevgenericfactory.h>
|
|
|
|
#include <kstdaction.h>
|
|
|
|
#include <tdemainwindow.h>
|
|
|
|
#include <tdemenubar.h>
|
|
|
|
|
|
|
|
#include <tdevcore.h>
|
|
|
|
#include <tdevmainwindow.h>
|
|
|
|
#include <tdevplugininfo.h>
|
|
|
|
|
|
|
|
#include "fullscreen_part.h"
|
|
|
|
|
|
|
|
static const TDevPluginInfo data("tdevfullscreen");
|
|
|
|
|
|
|
|
typedef TDevGenericFactory<FullScreenPart> FullScreenFactory;
|
|
|
|
K_EXPORT_COMPONENT_FACTORY( libtdevfullscreen, FullScreenFactory( data ) )
|
|
|
|
|
|
|
|
FullScreenPart::FullScreenPart(TQObject *parent, const char *name, const TQStringList& )
|
|
|
|
: TDevPlugin(&data, parent, name ? name : "FullScreenPart" )
|
|
|
|
{
|
|
|
|
setInstance(FullScreenFactory::instance());
|
|
|
|
// const TDEAboutData &abdata1 = *(info());
|
|
|
|
// kdDebug() << abdata1.appName() << endl;
|
|
|
|
const TDevPluginInfo &_info = *info();
|
|
|
|
const TDEAboutData *abdata = _info;
|
|
|
|
kdDebug() << abdata->appName() << endl;
|
|
|
|
setXMLFile("tdevpart_fullscreen.rc");
|
|
|
|
|
|
|
|
m_bFullScreen = false;
|
|
|
|
|
|
|
|
m_pFullScreen = KStdAction::fullScreen(this, TQT_SLOT(slotToggleFullScreen()), actionCollection(), mainWindow()->main());
|
|
|
|
}
|
|
|
|
|
|
|
|
FullScreenPart::~FullScreenPart()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void FullScreenPart::slotToggleFullScreen( )
|
|
|
|
{
|
|
|
|
m_bFullScreen = !m_bFullScreen;
|
|
|
|
if( m_bFullScreen ){
|
|
|
|
//mw->menuBar()->hide();
|
|
|
|
mainWindow()->main()->showFullScreen();
|
|
|
|
|
|
|
|
/*m_pFullScreen->setText( i18n( "Exit Full-Screen Mode" ) );
|
|
|
|
m_pFullScreen->setToolTip( i18n( "Exit full-screen mode" ) );
|
|
|
|
m_pFullScreen->setIcon( "window_nofullscreen" );*/
|
|
|
|
} else {
|
|
|
|
//mw->menuBar()->show();
|
|
|
|
|
|
|
|
mainWindow()->main()->showNormal();
|
|
|
|
|
|
|
|
/*m_pFullScreen->setText( i18n( "&Full-Screen Mode" ) );
|
|
|
|
m_pFullScreen->setToolTip(i18n("Full-screen mode"));
|
|
|
|
m_pFullScreen->setIcon( "window_fullscreen" );*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#include "fullscreen_part.moc"
|