Restructure source and resource files (#46)

importantly, res is now res/res and css is now res/css
This commit is contained in:
Dylam De La Torre
2021-11-23 05:21:56 +01:00
committed by GitHub
parent d88079000a
commit a51a54bc59
216 changed files with 21 additions and 33 deletions

View 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;
};