summaryrefslogtreecommitdiff
path: root/src/dialogs/friendpicker.hpp
blob: a7a147698780e20a3093b9342e35fe6b590f0096 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once

#include <gtkmm/dialog.h>
#include <gtkmm/image.h>
#include <gtkmm/label.h>
#include <gtkmm/listbox.h>
#include <gtkmm/scrolledwindow.h>

#include "discord/snowflake.hpp"

class FriendPickerDialog : public Gtk::Dialog {
public:
    FriendPickerDialog(Gtk::Window &parent);

    Snowflake GetUserID() const;

protected:
    void OnRowActivated(Gtk::ListBoxRow *row);
    void OnSelectionChange();

    Snowflake m_chosen_id;

    Gtk::ScrolledWindow m_main;
    Gtk::ListBox m_list;
    Gtk::ButtonBox m_bbox;

    Gtk::Button *m_ok_button;
    Gtk::Button *m_cancel_button;
};

class FriendPickerDialogItem : public Gtk::ListBoxRow {
public:
    FriendPickerDialogItem(Snowflake user_id);

    Snowflake ID;

private:
    Gtk::Box m_layout;
    Gtk::Image m_avatar;
    Gtk::Label m_name;
};