Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
0b61ede2
Commit
0b61ede2
authored
Sep 30, 2020
by
George Florea Bănuș
Browse files
rename readTabCountLimitConfig to readConfig
and handle setExpanding and setTabsClosable inside it
parent
d7e08cb0
Changes
2
Hide whitespace changes
Inline
Side-by-side
kate/katetabbar.cpp
View file @
0b61ede2
...
...
@@ -33,9 +33,6 @@ Q_DECLARE_METATYPE(KateTabButtonData)
KateTabBar
::
KateTabBar
(
QWidget
*
parent
)
:
QTabBar
(
parent
)
{
KSharedConfig
::
Ptr
config
=
KSharedConfig
::
openConfig
();
KConfigGroup
cgGeneral
=
KConfigGroup
(
config
,
"General"
);
// enable document mode, docs tell this will trigger:
// On macOS this will look similar to the tabs in Safari or Sierra's Terminal.app.
// this seems reasonable for our document tabs
...
...
@@ -44,27 +41,17 @@ KateTabBar::KateTabBar(QWidget *parent)
// we want drag and drop
setAcceptDrops
(
true
);
// use as much size as possible for each tab
setExpanding
(
cgGeneral
.
readEntry
(
"Expand Tabs"
,
true
));
// document close function should be there
setTabsClosable
(
cgGeneral
.
readEntry
(
"Show Tabs Close Button"
,
true
));
// allow users to re-arrange the tabs
setMovable
(
true
);
// enforce configured limit
read
TabCountLimit
Config
();
readConfig
();
// handle config changes
connect
(
KateApp
::
self
(),
&
KateApp
::
configurationChanged
,
this
,
&
KateTabBar
::
readTabCountLimitConfig
);
connect
(
KateApp
::
self
(),
&
KateApp
::
configurationChanged
,
this
,
[
=
]()
{
setExpanding
(
cgGeneral
.
readEntry
(
"Expand Tabs"
,
true
));
setTabsClosable
(
cgGeneral
.
readEntry
(
"Show Tabs Close Button"
,
true
));
});
connect
(
KateApp
::
self
(),
&
KateApp
::
configurationChanged
,
this
,
&
KateTabBar
::
readConfig
);
}
void
KateTabBar
::
read
TabCountLimit
Config
()
void
KateTabBar
::
readConfig
()
{
KSharedConfig
::
Ptr
config
=
KSharedConfig
::
openConfig
();
KConfigGroup
cgGeneral
=
KConfigGroup
(
config
,
"General"
);
...
...
@@ -87,6 +74,10 @@ void KateTabBar::readTabCountLimitConfig()
}
setCurrentIndex
(
0
);
}
// handle tab close button and expansion
setExpanding
(
cgGeneral
.
readEntry
(
"Expand Tabs"
,
true
));
setTabsClosable
(
cgGeneral
.
readEntry
(
"Show Tabs Close Button"
,
true
));
}
void
KateTabBar
::
setActive
(
bool
active
)
...
...
kate/katetabbar.h
View file @
0b61ede2
...
...
@@ -37,7 +37,7 @@ public:
/**
* Read and apply tab limit as configured
*/
void
read
TabCountLimit
Config
();
void
readConfig
();
void
tabInserted
(
int
idx
)
override
;
...
...
Write
Preview
Supports
Markdown
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