From df5a8d26c398ad65f09bd26c492c08f6c0ee22e0 Mon Sep 17 00:00:00 2001 From: harlekin Date: Thu, 17 Oct 2002 17:19:20 +0000 Subject: fullscreen mode ready --- (limited to 'noncore') diff --git a/noncore/apps/opie-console/TEWidget.cpp b/noncore/apps/opie-console/TEWidget.cpp index 75c438c..f3f462f 100644 --- a/noncore/apps/opie-console/TEWidget.cpp +++ b/noncore/apps/opie-console/TEWidget.cpp @@ -60,6 +60,7 @@ #include #include #include +#include #include #include @@ -71,6 +72,8 @@ #include + + // #include "TEWidget.moc" //#include //#include @@ -274,7 +277,9 @@ void TEWidget::setFont(const QFont &) /* */ /* Constructor / Destructor */ /* */ -/* ------------------------------------------------------------------------- */ +/* ----------------------------------------------------------------------- */ + + TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name) { @@ -284,10 +289,16 @@ TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name) this, SLOT(onClearSelection()) ); #endif - scrollbar = new QScrollBar(this); + + scrollbar = new QScrollBar( this ); scrollbar->setCursor( arrowCursor ); connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int))); + m_cornerButton = new QPushButton( this ); + m_cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) ); + m_cornerButton->setMaximumSize( 14, 14 ); + m_cornerButton->hide(); + Config cfg("Konsole"); cfg.setGroup("ScrollBar"); switch( cfg.readNumEntry("Position",2)){ @@ -854,7 +865,7 @@ void TEWidget::mouseDoubleClickEvent(QMouseEvent* ev) void TEWidget::focusInEvent( QFocusEvent * ) { - + // do nothing, to prevent repainting } @@ -1262,3 +1273,6 @@ void TEWidget::drop_menu_activated(int item) #endif } +QPushButton* TEWidget::cornerButton() { + return m_cornerButton; +} diff --git a/noncore/apps/opie-console/TEWidget.h b/noncore/apps/opie-console/TEWidget.h index 40e1aea..1b5300f 100644 --- a/noncore/apps/opie-console/TEWidget.h +++ b/noncore/apps/opie-console/TEWidget.h @@ -26,18 +26,42 @@ #include #include +#include #include "TECommon.h" extern unsigned short vt100_graphics[32]; + + +static char * menu_xpm[] = { +"12 12 5 1", +" c None", +". c #000000", +"+ c #FFFDAD", +"@ c #FFFF00", +"# c #E5E100", +" ", +" ", +" ......... ", +" .+++++++. ", +" .+@@@@#. ", +" .+@@@#. ", +" .+@@#. ", +" .+@#. ", +" .+#. ", +" .+. ", +" .. ", +" "}; + class TESession; // class Konsole; class TEWidget : public QFrame // a widget representing attributed text -{ Q_OBJECT +{ + Q_OBJECT // friend class Konsole; @@ -49,6 +73,7 @@ public: public: QColor getDefaultBackColor(); + QPushButton *cornerButton(); const ColorEntry* getColorTable() const; const ColorEntry* getdefaultColorTable() const; @@ -131,7 +156,7 @@ protected: public: const QPixmap *backgroundPixmap(); - + void setSelection(const QString &t); virtual void setFont(const QFont &); @@ -179,6 +204,7 @@ private: BOOL word_selection_mode; BOOL preserve_line_breaks; + QPushButton *m_cornerButton; QClipboard* cb; QScrollBar* scrollbar; int scrollLoc; diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp index b2cd348..8846959 100644 --- a/noncore/apps/opie-console/emulation_handler.cpp +++ b/noncore/apps/opie-console/emulation_handler.cpp @@ -1,4 +1,5 @@ #include +#include #include "TEWidget.h" #include "TEmuVt102.h" @@ -140,3 +141,7 @@ QColor EmulationHandler::backColor(int col ) { return co; } + +QPushButton* EmulationHandler::cornerButton() { + return m_teWid->cornerButton(); +} diff --git a/noncore/apps/opie-console/emulation_handler.h b/noncore/apps/opie-console/emulation_handler.h index 9af7680..9ceafc6 100644 --- a/noncore/apps/opie-console/emulation_handler.h +++ b/noncore/apps/opie-console/emulation_handler.h @@ -25,6 +25,7 @@ */ class Profile; class QWidget; +class QPushButton; class TEWidget; class TEmulation; class QFont; @@ -46,6 +47,8 @@ public: void load( const Profile& ); QWidget* widget(); void setColor( const QColor& fore, const QColor& back ); + QPushButton* cornerButton(); + signals: void send( const QByteArray& ); void changeSize(int rows, int cols ); diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp index d71aacc..4486eea 100644 --- a/noncore/apps/opie-console/io_bt.cpp +++ b/noncore/apps/opie-console/io_bt.cpp @@ -29,7 +29,6 @@ bool IOBt::open() { if ( !m_mac.isEmpty() ) { // now it should also be checked, if there is a connection to the device with that mac allready - // hciattach here m_attach = new OProcess(); *m_attach << "hciattach /dev/ttyS2 any 57600"; diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 5295600..408d3dd 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -26,31 +26,11 @@ #include "tabwidget.h" #include "transferdialog.h" #include "function_keyboard.h" +#include "emulation_handler.h" #include "script.h" -static char * menu_xpm[] = { -"12 12 5 1", -" c None", -". c #000000", -"+ c #FFFDAD", -"@ c #FFFF00", -"# c #E5E100", -" ", -" ", -" ......... ", -" .+++++++. ", -" .+@@@@#. ", -" .+@@@#. ", -" .+@@#. ", -" .+@#. ", -" .+#. ", -" .+. ", -" .. ", -" "}; - - MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { KeyTrans::loadAll(); for (int i = 0; i < KeyTrans::count(); i++ ) { @@ -462,25 +442,23 @@ void MainWindow::slotFullscreen() { ( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken ); setCentralWidget( m_consoleWindow ); ( m_curSession->widgetStack() )->show(); - m_fullscreen->setText( tr("Full screen") ); + ( m_curSession->emulationHandler() )->cornerButton()->hide(); + disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); } else { ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame ); ( m_curSession->widgetStack() )->reparent( 0,WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop - , QPoint(0,0), false); - ( m_curSession->widgetStack() )->resize(qApp->desktop()->width(), qApp->desktop()->height()); + , QPoint(0,0), false ); + ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() ); ( m_curSession->widgetStack() )->setFocus(); ( m_curSession->widgetStack() )->show(); - QPushButton *cornerButton = new QPushButton( m_curSession->widgetStack() ); - cornerButton->setPixmap( QPixmap( (const char**)menu_xpm ) ); - connect( cornerButton, SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); - // would need a scrollview - // ( m_curSession->widgetStack() )->setCornerWidget( cornerButton ); - m_fullscreen->setText( tr("Stop full screen") ); + ( ( m_curSession->emulationHandler() )->cornerButton() )->show(); + + connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); } - m_isFullscreen = !m_isFullscreen; + m_isFullscreen = !m_isFullscreen; } -- cgit v0.9.0.2