From 2856dd4378a62abf4f0b9ef1939ae95acf9c42d7 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 26 Oct 2018 12:59:38 +0200 Subject: Fix line wrap for messages --- src/ChatMessage.cpp | 1 + src/ChatWindow.cpp | 1 + src/Window.cpp | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/ChatMessage.cpp b/src/ChatMessage.cpp index 6dbd671..048bfca 100644 --- a/src/ChatMessage.cpp +++ b/src/ChatMessage.cpp @@ -12,6 +12,7 @@ namespace dchat text.set_selectable(true); text.set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_START); + text.set_line_wrap(true); text.set_line_wrap_mode(Pango::WRAP_WORD_CHAR); text.get_style_context()->add_class("chat-message-text"); diff --git a/src/ChatWindow.cpp b/src/ChatWindow.cpp index 70dd734..4d513e4 100644 --- a/src/ChatWindow.cpp +++ b/src/ChatWindow.cpp @@ -80,6 +80,7 @@ namespace dchat void ChatWindow::setupMessageArea(Gtk::Grid *rightPanel) { chatArea.set_vexpand(true); + chatArea.set_policy(Gtk::PolicyType::POLICY_NEVER, Gtk::PolicyType::POLICY_AUTOMATIC) rightPanel->attach(chatArea, 0, 0, 1, 2); chatAreaLayout.set_name("chat-area-layout"); diff --git a/src/Window.cpp b/src/Window.cpp index 5f27000..6493b2d 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -9,6 +9,8 @@ namespace dchat set_border_width(0); add(stack); + stack.set_transition_type(Gtk::StackTransitionType::STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT); + stack.set_transition_duration(250); stack.add(loginWindow, "login"); stack.add(chatWindow, "chat"); -- cgit v1.2.3