-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
872c912
commit aa80b74
Showing
12 changed files
with
302 additions
and
449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,11 @@ | |
|
||
============ | ||
|
||
## 0.0.70 | ||
|
||
- Implemented: | ||
- View Menu -> Toggle to Former Tab | ||
|
||
## 0.0.69 | ||
|
||
- Implemented: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include "toggletoformertab.h" | ||
|
||
ToggleToFormerTab::ToggleToFormerTab(QTabWidget* tabWidget) | ||
: m_tabWidget(tabWidget), | ||
m_currentTabIndex(-1), | ||
m_formerTabIndex(-1), | ||
m_isToggleToFormerTabActive(false) { | ||
if (m_tabWidget && m_tabWidget->count() > 0) { | ||
m_currentTabIndex = m_tabWidget->currentIndex(); | ||
} | ||
} | ||
|
||
void ToggleToFormerTab::updateTabIndex(int currentIndex) { | ||
if (currentIndex == m_currentTabIndex) | ||
return; | ||
|
||
m_formerTabIndex = m_currentTabIndex; | ||
m_currentTabIndex = currentIndex; | ||
} | ||
|
||
void ToggleToFormerTab::setToggleActive(bool active) { | ||
m_isToggleToFormerTabActive = active; | ||
if (m_isToggleToFormerTabActive) { | ||
toggle(); | ||
} | ||
} | ||
|
||
void ToggleToFormerTab::toggle() { | ||
if (!m_tabWidget || m_formerTabIndex == -1) { | ||
return; // No former tab to toggle to | ||
} | ||
|
||
// Swap current and former indices and activate the former tab | ||
std::swap(m_currentTabIndex, m_formerTabIndex); | ||
m_tabWidget->setCurrentIndex(m_currentTabIndex); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
#include <QTabWidget> | ||
|
||
class ToggleToFormerTab { | ||
public: | ||
explicit ToggleToFormerTab(QTabWidget* tabWidget); | ||
|
||
void toggle(); // Perform the toggle operation | ||
void updateTabIndex(int currentIndex); // Update tab indices | ||
void setToggleActive(bool active); // Set toggle state | ||
|
||
private: | ||
QTabWidget* m_tabWidget; | ||
int m_currentTabIndex; | ||
int m_formerTabIndex; | ||
bool m_isToggleToFormerTabActive; // Toggle active state | ||
}; |