mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-27 16:16:35 +03:00
Restructure source and resource files (#46)
importantly, res is now res/res and css is now res/css
This commit is contained in:
committed by
GitHub
parent
d88079000a
commit
a51a54bc59
79
src/windows/threadswindow.hpp
Normal file
79
src/windows/threadswindow.hpp
Normal file
@@ -0,0 +1,79 @@
|
||||
#pragma once
|
||||
#include <gtkmm.h>
|
||||
#include "discord/objects.hpp"
|
||||
|
||||
class ActiveThreadsList : public Gtk::ScrolledWindow {
|
||||
public:
|
||||
ActiveThreadsList(const ChannelData &channel, const Gtk::ListBox::SlotFilter &filter);
|
||||
|
||||
void InvalidateFilter();
|
||||
|
||||
private:
|
||||
Gtk::ListBox m_list;
|
||||
|
||||
using type_signal_thread_open = sigc::signal<void, Snowflake>;
|
||||
type_signal_thread_open m_signal_thread_open;
|
||||
|
||||
public:
|
||||
type_signal_thread_open signal_thread_open();
|
||||
};
|
||||
|
||||
class ArchivedThreadsList : public Gtk::ScrolledWindow {
|
||||
public:
|
||||
ArchivedThreadsList(const ChannelData &channel, const Gtk::ListBox::SlotFilter &filter);
|
||||
|
||||
void InvalidateFilter();
|
||||
|
||||
private:
|
||||
Gtk::ListBox m_list;
|
||||
|
||||
void OnPublicFetched(DiscordError code, const ArchivedThreadsResponseData &data);
|
||||
|
||||
using type_signal_thread_open = sigc::signal<void, Snowflake>;
|
||||
type_signal_thread_open m_signal_thread_open;
|
||||
|
||||
public:
|
||||
type_signal_thread_open signal_thread_open();
|
||||
};
|
||||
|
||||
// view all threads in a channel
|
||||
class ThreadsWindow : public Gtk::Window {
|
||||
public:
|
||||
ThreadsWindow(const ChannelData &channel);
|
||||
|
||||
private:
|
||||
// this filtering is rather cringe but idk what a better alternative would be
|
||||
bool ListFilterFunc(Gtk::ListBoxRow *row_);
|
||||
|
||||
enum FilterMode {
|
||||
FILTER_PUBLIC = 0,
|
||||
FILTER_PRIVATE = 1,
|
||||
};
|
||||
bool m_filter_mode = FILTER_PUBLIC;
|
||||
|
||||
Snowflake m_channel_id;
|
||||
|
||||
Gtk::StackSwitcher m_switcher;
|
||||
Gtk::Stack m_stack;
|
||||
|
||||
Gtk::RadioButtonGroup m_group;
|
||||
Gtk::ButtonBox m_filter_buttons;
|
||||
Gtk::RadioButton m_filter_public;
|
||||
Gtk::RadioButton m_filter_private;
|
||||
|
||||
Gtk::Box m_box;
|
||||
|
||||
ActiveThreadsList m_active;
|
||||
ArchivedThreadsList m_archived;
|
||||
};
|
||||
|
||||
class ThreadListRow : public Gtk::ListBoxRow {
|
||||
public:
|
||||
ThreadListRow(const ChannelData &channel);
|
||||
|
||||
Snowflake ID;
|
||||
ChannelType Type;
|
||||
|
||||
private:
|
||||
Gtk::Label m_label;
|
||||
};
|
||||
Reference in New Issue
Block a user