Commit b40a006d authored by Kurt Hindenburg's avatar Kurt Hindenburg

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 <chali.ahmul@atlas.cz>
FEATURE: 169054
FIXED-IN: 4.8
parent febd3c63
......@@ -260,6 +260,7 @@ void EditProfileDialog::setupGeneralPage(const Profile::Ptr info)
// window options
_ui->showMenuBarButton->setChecked( info->property<bool>(Profile::ShowMenuBar) );
_ui->showSizeWidgetButton->setChecked( info->property<bool>(Profile::ShowSizeWidget) );
_ui->saveGeometryOnExitButton->setChecked( info->property<bool>(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);
......
......@@ -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);
......
......@@ -237,6 +237,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="showSizeWidgetButton" >
<property name="toolTip" >
<string>Show new size of the terminal after resizing</string>
</property>
<property name="text" >
<string>Show terminal size after resizing</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......
......@@ -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);
......
......@@ -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. */
......
......@@ -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)
......
......@@ -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
......
......@@ -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<bool>(Profile::ShowSizeWidget));
// terminal features
bool blinkingCursor = info->property<bool>(Profile::BlinkingCursorEnabled);
view->setBlinkingCursor(blinkingCursor);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment