Skip to content

Commit 4f73d89

Browse files
committed
chore(stack): Tab state defaults to non_active
1 parent e5a3385 commit 4f73d89

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/shell/element/stack/tab.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,6 @@ impl<Message: TabMessage + 'static> Tab<Message> {
164164
self
165165
}
166166

167-
pub(super) fn non_active(mut self) -> Self {
168-
self.active = false;
169-
self
170-
}
171-
172167
pub(super) fn active(mut self) -> Self {
173168
self.active = true;
174169
self

src/shell/element/stack/tabs.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,14 @@ where
137137
activated: bool,
138138
group_focused: bool,
139139
) -> Self {
140-
let tabs = tabs.into_iter().enumerate().map(|(i, tab)| {
140+
let tabs = tabs.into_iter().enumerate().map(|(i, mut tab)| {
141141
let rule = if activated {
142142
TabRuleTheme::ActiveActivated
143143
} else {
144144
TabRuleTheme::ActiveDeactivated
145145
};
146146

147-
let tab = if i == active {
147+
tab = if i == active {
148148
tab.rule_style(rule)
149149
.background_style(if activated {
150150
TabBackgroundTheme::ActiveActivated
@@ -154,9 +154,9 @@ where
154154
.font(cosmic::font::semibold())
155155
.active()
156156
} else if i.checked_sub(1) == Some(active) {
157-
tab.rule_style(rule).non_active()
157+
tab.rule_style(rule)
158158
} else {
159-
tab.non_active()
159+
tab
160160
};
161161

162162
Element::new(tab.internal(i))

0 commit comments

Comments
 (0)