From b40a006db852bd8eeaa326588591883accd6db6f Mon Sep 17 00:00:00 2001 From: Kurt Hindenburg Date: Sun, 31 Jul 2011 20:56:16 -0400 Subject: [PATCH] Add a checkbox to hide the size widget upon resizing window. Re-add the KDE 3 option to show/hide the size widget when the window is changed. Patch is years old from Chali Ahmul M.P.U FEATURE: 169054 FIXED-IN: 4.8 --- src/EditProfileDialog.cpp | 8 ++++++++ src/EditProfileDialog.h | 1 + src/EditProfileDialog.ui | 10 ++++++++++ src/Profile.cpp | 2 ++ src/Profile.h | 2 ++ src/TerminalDisplay.cpp | 7 +++++++ src/TerminalDisplay.h | 5 +++++ src/ViewManager.cpp | 3 +++ 8 files changed, 38 insertions(+) diff --git a/src/EditProfileDialog.cpp b/src/EditProfileDialog.cpp index 57d765605..92a5624fd 100644 --- a/src/EditProfileDialog.cpp +++ b/src/EditProfileDialog.cpp @@ -260,6 +260,7 @@ void EditProfileDialog::setupGeneralPage(const Profile::Ptr info) // window options _ui->showMenuBarButton->setChecked( info->property(Profile::ShowMenuBar) ); + _ui->showSizeWidgetButton->setChecked( info->property(Profile::ShowSizeWidget) ); _ui->saveGeometryOnExitButton->setChecked( info->property(Profile::SaveGeometryOnExit) ); // signals and slots @@ -279,6 +280,9 @@ void EditProfileDialog::setupGeneralPage(const Profile::Ptr info) connect(_ui->saveGeometryOnExitButton , SIGNAL(toggled(bool)) , this , SLOT(saveGeometryOnExit(bool)) ); + connect(_ui->showSizeWidgetButton , SIGNAL(toggled(bool)) , this , + SLOT(showSizeWidget(bool)) ); + connect(_ui->environmentEditButton , SIGNAL(clicked()) , this , SLOT(showEnvironmentEditor()) ); } @@ -385,6 +389,10 @@ void EditProfileDialog::saveGeometryOnExit(bool save) { updateTempProfileProperty(Profile::SaveGeometryOnExit,save); } +void EditProfileDialog::showSizeWidget(bool show) +{ + _tempProfile->setProperty(Profile::ShowSizeWidget,show); +} void EditProfileDialog::tabTitleFormatChanged(const QString& format) { updateTempProfileProperty(Profile::LocalTabTitleFormat,format); diff --git a/src/EditProfileDialog.h b/src/EditProfileDialog.h index 17e73df0a..dc84d522c 100644 --- a/src/EditProfileDialog.h +++ b/src/EditProfileDialog.h @@ -120,6 +120,7 @@ private slots: void insertRemoteTabTitleText(const QString& text); void showMenuBar(bool); + void showSizeWidget(bool); void saveGeometryOnExit(bool); void showEnvironmentEditor(); void tabBarVisibilityChanged(int); diff --git a/src/EditProfileDialog.ui b/src/EditProfileDialog.ui index efaa0b41c..8883298dc 100644 --- a/src/EditProfileDialog.ui +++ b/src/EditProfileDialog.ui @@ -237,6 +237,16 @@ + + + + Show new size of the terminal after resizing + + + Show terminal size after resizing + + + diff --git a/src/Profile.cpp b/src/Profile.cpp index 32badb125..871f5109d 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -76,6 +76,7 @@ const Profile::PropertyInfo Profile::DefaultPropertyNames[] = , { LocalTabTitleFormat , "tabtitle" , 0 , QVariant::String } , { RemoteTabTitleFormat , "RemoteTabTitleFormat" , GENERAL_GROUP , QVariant::String } , { ShowMenuBar , "ShowMenuBar" , GENERAL_GROUP , QVariant::Bool } + , { ShowSizeWidget , "ShowSizeWidget" , GENERAL_GROUP , QVariant::Bool } , { SaveGeometryOnExit , "SaveGeometryOnExit" , GENERAL_GROUP , QVariant::Bool } , { TabBarMode , "TabBarMode" , GENERAL_GROUP , QVariant::Int } , { TabBarPosition , "TabBarPosition" , GENERAL_GROUP , QVariant::Int } @@ -158,6 +159,7 @@ FallbackProfile::FallbackProfile() setProperty(TabBarMode,AlwaysShowTabBar); setProperty(TabBarPosition,TabBarBottom); setProperty(ShowMenuBar,true); + setProperty(ShowSizeWidget,true); setProperty(SaveGeometryOnExit,true); setProperty(StartInCurrentSessionDir,true); setProperty(ShowNewAndCloseTabButtons,false); diff --git a/src/Profile.h b/src/Profile.h index 2410e36da..8756f5890 100644 --- a/src/Profile.h +++ b/src/Profile.h @@ -114,6 +114,8 @@ public: RemoteTabTitleFormat, /** (bool) Specifies whether the menu bar should be shown in the main application window. */ ShowMenuBar, + /** (bool) Specifies whether show size information after resizing the application window. */ + ShowSizeWidget, SaveGeometryOnExit, /** (TabBarModeEnum) Specifies when the tab bar should be shown in * the main application window. */ diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp index 634cf7cb9..f9c775d61 100644 --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -306,6 +306,7 @@ TerminalDisplay::TerminalDisplay(QWidget *parent) ,_scrollbarLocation(NoScrollBar) ,_wordCharacters(":@-./_~") ,_bellMode(SystemBeepBell) +,_showSizeWidget(true) ,_blinking(false) ,_hasBlinker(false) ,_cursorBlinking(false) @@ -1623,6 +1624,7 @@ void TerminalDisplay::updateImageSize() if ( _resizing ) { + if (_showSizeWidget) showResizeNotification(); emit changedContentSizeSignal(_contentHeight, _contentWidth); // expose resizeEvent } @@ -2403,6 +2405,11 @@ void TerminalDisplay::mouseTripleClickEvent(QMouseEvent* ev) } +void Konsole::TerminalDisplay::setSizeWidgetVisibility(bool visible) +{ + _showSizeWidget = visible; +} + bool TerminalDisplay::focusNextPrevChild( bool next ) { if (next) diff --git a/src/TerminalDisplay.h b/src/TerminalDisplay.h index 0fd4a9081..b77b07ac4 100644 --- a/src/TerminalDisplay.h +++ b/src/TerminalDisplay.h @@ -117,6 +117,10 @@ public: void setScroll(int cursor, int lines); /** + * Sets if the size widget is going to be shown or not + */ + void setSizeWidgetVisibility(bool visible); + /** * Returns the display's filter chain. When the image for the display is updated, * the text is passed through each filter in the chain. Each filter can define * hotspots which correspond to certain strings (such as URLs or particular words). @@ -750,6 +754,7 @@ private: QString _wordCharacters; int _bellMode; + bool _showSizeWidget; // if the size widget will be show bool _blinking; // hide text in paintEvent bool _hasBlinker; // has characters to blink bool _cursorBlinking; // hide cursor in paintEvent diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp index 4f7369ea9..dd028cb78 100644 --- a/src/ViewManager.cpp +++ b/src/ViewManager.cpp @@ -868,6 +868,9 @@ void ViewManager::applyProfile(TerminalDisplay* view , const Profile::Ptr info, else if ( scrollBarPosition == Profile::ScrollBarRight ) view->setScrollBarPosition(TerminalDisplay::ScrollBarRight); + // set visibility of the size widget + view->setSizeWidgetVisibility(info->property(Profile::ShowSizeWidget)); + // terminal features bool blinkingCursor = info->property(Profile::BlinkingCursorEnabled); view->setBlinkingCursor(blinkingCursor);