Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Friedrich W. H. Kossebau
kdevelop
Commits
91112821
Commit
91112821
authored
Sep 06, 2019
by
Thomas Schöps
Committed by
Thomas Schöps
Dec 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a setting to disable the close buttons on tabs
parent
7cb06699
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
3 deletions
+52
-3
kdevplatform/shell/settings/uiconfig.kcfg
kdevplatform/shell/settings/uiconfig.kcfg
+3
-0
kdevplatform/shell/settings/uiconfig.ui
kdevplatform/shell/settings/uiconfig.ui
+31
-2
kdevplatform/sublime/container.cpp
kdevplatform/sublime/container.cpp
+14
-1
kdevplatform/sublime/container.h
kdevplatform/sublime/container.h
+2
-0
kdevplatform/sublime/mainwindow.cpp
kdevplatform/sublime/mainwindow.cpp
+2
-0
No files found.
kdevplatform/shell/settings/uiconfig.kcfg
View file @
91112821
...
...
@@ -12,6 +12,9 @@
<entry
name=
"TabBarVisibility"
key=
"TabBarVisibility"
type=
"Int"
>
<default>
1
</default>
</entry>
<entry
name=
"CloseButtonsOnTabs"
key=
"CloseButtonsOnTabs"
type=
"Int"
>
<default>
1
</default>
</entry>
<entry
name=
"TabBarOpenAfterCurrent"
key=
"TabBarOpenAfterCurrent"
type=
"Int"
>
<default>
1
</default>
</entry>
...
...
kdevplatform/shell/settings/uiconfig.ui
View file @
91112821
...
...
@@ -86,7 +86,7 @@
<string>
Tabbed Browsing
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout_1"
>
<item
row=
"
1
"
column=
"0"
>
<item
row=
"
2
"
column=
"0"
>
<widget
class=
"QCheckBox"
name=
"kcfg_TabBarOpenAfterCurrent"
>
<property
name=
"toolTip"
>
<string>
Controls whether to open new tabs next to the active one.
</string>
...
...
@@ -99,7 +99,7 @@
</property>
</widget>
</item>
<item
row=
"
2
"
column=
"0"
>
<item
row=
"
3
"
column=
"0"
>
<widget
class=
"QCheckBox"
name=
"kcfg_TabBarArrangeBuddies"
>
<property
name=
"toolTip"
>
<string>
When enabled, plugins can group related files side by side.
...
...
@@ -123,6 +123,19 @@ For example, a header file will be opened next to the implementation file.</stri
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QCheckBox"
name=
"kcfg_CloseButtonsOnTabs"
>
<property
name=
"toolTip"
>
<string>
Enables or disables the display of a close button in each tab in the tab bar at the top of the editor window.
</string>
</property>
<property
name=
"text"
>
<string>
Show close buttons on tabs
</string>
</property>
<property
name=
"checked"
>
<bool>
true
</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
...
...
@@ -191,5 +204,21 @@ For example, a header file will be opened next to the implementation file.</stri
</hint>
</hints>
</connection>
<connection>
<sender>
kcfg_TabBarVisibility
</sender>
<signal>
toggled(bool)
</signal>
<receiver>
kcfg_CloseButtonsOnTabs
</receiver>
<slot>
setEnabled(bool)
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
260
</x>
<y>
133
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
260
</x>
<y>
158
</y>
</hint>
</hints>
</connection>
</connections>
</ui>
kdevplatform/sublime/container.cpp
View file @
91112821
...
...
@@ -365,7 +365,7 @@ Container::Container(QWidget *parent)
setTabBarHidden
(
!
configTabBarVisible
());
d
->
tabBar
->
setTabsClosable
(
true
);
d
->
tabBar
->
setTabsClosable
(
configCloseButtonsOnTabs
()
);
d
->
tabBar
->
setMovable
(
true
);
d
->
tabBar
->
setExpanding
(
false
);
d
->
tabBar
->
setSelectionBehaviorOnRemove
(
QTabBar
::
SelectPreviousTab
);
...
...
@@ -379,6 +379,12 @@ bool Container::configTabBarVisible()
return
group
.
readEntry
(
"TabBarVisibility"
,
1
);
}
bool
Container
::
configCloseButtonsOnTabs
()
{
KConfigGroup
group
=
KSharedConfig
::
openConfig
()
->
group
(
"UiSettings"
);
return
group
.
readEntry
(
"CloseButtonsOnTabs"
,
1
);
}
void
Container
::
setLeftCornerWidget
(
QWidget
*
widget
)
{
Q_D
(
Container
);
...
...
@@ -632,6 +638,13 @@ void Container::setTabBarHidden(bool hide)
}
}
void
Container
::
setCloseButtonsOnTabs
(
bool
show
)
{
Q_D
(
Container
);
d
->
tabBar
->
setTabsClosable
(
show
);
}
void
Container
::
resetTabColors
(
const
QColor
&
color
)
{
Q_D
(
Container
);
...
...
kdevplatform/sublime/container.h
View file @
91112821
...
...
@@ -61,6 +61,7 @@ public:
View
*
viewForWidget
(
QWidget
*
w
)
const
;
void
setTabBarHidden
(
bool
hide
);
void
setCloseButtonsOnTabs
(
bool
show
);
void
setTabColor
(
const
View
*
view
,
const
QColor
&
color
);
void
setTabColors
(
const
QHash
<
const
View
*
,
QColor
>&
colors
);
...
...
@@ -76,6 +77,7 @@ public:
QRect
tabRect
(
int
tab
)
const
;
static
bool
configTabBarVisible
();
static
bool
configCloseButtonsOnTabs
();
Q_SIGNALS:
void
activateView
(
Sublime
::
View
*
view
);
...
...
kdevplatform/sublime/mainwindow.cpp
View file @
91112821
...
...
@@ -351,8 +351,10 @@ void MainWindow::loadSettings()
}
const
bool
tabBarHidden
=
!
Container
::
configTabBarVisible
();
const
bool
closeButtonsOnTabs
=
Container
::
configCloseButtonsOnTabs
();
for
(
Container
*
container
:
qAsConst
(
d
->
viewContainers
))
{
container
->
setTabBarHidden
(
tabBarHidden
);
container
->
setCloseButtonsOnTabs
(
closeButtonsOnTabs
);
}
hu
.
stop
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment