From e8f16292d1774ea137145485a63c373df6cb0743 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Wed, 27 Apr 2022 16:23:50 -0400 Subject: add back/forward history to tabs also lots of reformatting in .cmake because clion is weird and did that for some reason --- src/components/channeltabswitcherhandy.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/components/channeltabswitcherhandy.hpp') diff --git a/src/components/channeltabswitcherhandy.hpp b/src/components/channeltabswitcherhandy.hpp index 41c9c92..37a71ee 100644 --- a/src/components/channeltabswitcherhandy.hpp +++ b/src/components/channeltabswitcherhandy.hpp @@ -22,11 +22,16 @@ public: TabsState GetTabsState(); void UseTabsState(const TabsState &state); + void GoBackOnCurrent(); + void GoForwardOnCurrent(); + private: void CheckUnread(Snowflake id); void ClearPage(HdyTabPage *page); void OnPageIconLoad(HdyTabPage *page, const Glib::RefPtr &pb); void CheckPageIcon(HdyTabPage *page, const ChannelData &data); + void AppendPageHistory(HdyTabPage *page, Snowflake channel); + void AdvanceOnCurrent(size_t by); HdyTabBar *m_tab_bar; Gtk::Widget *m_tab_bar_wrapped; @@ -38,6 +43,13 @@ private: // need to hold a reference to the pixbuf data std::unordered_map> m_page_icons; + struct PageHistory { + std::vector Visited; + size_t CurrentVisitedIndex; + }; + + std::unordered_map m_page_history; + friend void selected_page_notify_cb(HdyTabView *, GParamSpec *, ChannelTabSwitcherHandy *); friend gboolean close_page_cb(HdyTabView *, HdyTabPage *, ChannelTabSwitcherHandy *); -- cgit v1.2.3