change up set status dialog

This commit is contained in:
ouwou
2023-11-27 02:48:34 -05:00
parent c61feb9f01
commit 50d99de060
3 changed files with 37 additions and 16 deletions

View File

@@ -1,17 +1,31 @@
#include "setstatus.hpp"
static const std::array feelings = {
"wonderful",
"splendiferous",
"delicious",
"outstanding",
"amazing",
"great",
"marvelous",
"superb",
"out of this world",
"stupendous",
"tip-top",
"horrible",
};
SetStatusDialog::SetStatusDialog(Gtk::Window &parent)
: Gtk::Dialog("Set Status", parent, true)
, m_layout(Gtk::ORIENTATION_VERTICAL)
, m_bottom(Gtk::ORIENTATION_HORIZONTAL)
, m_ok("OK")
, m_cancel("Cancel")
, m_bbox(Gtk::ORIENTATION_HORIZONTAL) {
set_default_size(300, 50);
, m_cancel("Cancel") {
set_default_size(350, 200);
get_style_context()->add_class("app-window");
get_style_context()->add_class("app-popup");
get_style_context()->add_class("set-status-dialog");
m_text.set_placeholder_text("Status text");
m_text.set_placeholder_text("I feel " + Glib::ustring(feelings[rand() % feelings.size()]) + "!");
m_status_combo.append("online", "Online");
m_status_combo.append("dnd", "Do Not Disturb");
@@ -35,16 +49,17 @@ SetStatusDialog::SetStatusDialog(Gtk::Window &parent)
response(Gtk::RESPONSE_CANCEL);
});
m_bbox.pack_start(m_ok, Gtk::PACK_SHRINK);
m_bbox.pack_start(m_cancel, Gtk::PACK_SHRINK);
m_bbox.set_layout(Gtk::BUTTONBOX_END);
m_layout.pack_start(*Gtk::make_managed<Gtk::Label>("How are you, " + Abaddon::Get().GetDiscordClient().GetUserData().GetDisplayName() + "?", Gtk::ALIGN_START));
m_layout.pack_start(m_text);
m_layout.pack_start(*Gtk::make_managed<Gtk::Label>("Status", Gtk::ALIGN_START));
m_layout.pack_start(m_status_combo);
m_layout.pack_start(*Gtk::make_managed<Gtk::Label>("Activity", Gtk::ALIGN_START));
m_layout.pack_start(m_type_combo);
m_bottom.add(m_status_combo);
m_bottom.add(m_type_combo);
m_bottom.add(m_bbox);
m_layout.add(m_text);
m_layout.add(m_bottom);
get_content_area()->add(m_layout);
get_action_area()->pack_start(m_ok, Gtk::PACK_SHRINK);
get_action_area()->pack_start(m_cancel, Gtk::PACK_SHRINK);
get_action_area()->set_layout(Gtk::BUTTONBOX_START);
show_all_children();
}