From a5d4a43d93f1acc5b0fabe98e45bffb1bcbe34b3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 30 Apr 2015 16:07:15 +0300 Subject: Use scrollarea for mail list. --- src/gui/windows/mailwindow.cpp | 7 ++++++- src/gui/windows/mailwindow.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp index aec30ce89..b23984c4c 100644 --- a/src/gui/windows/mailwindow.cpp +++ b/src/gui/windows/mailwindow.cpp @@ -36,6 +36,7 @@ #include "gui/widgets/label.h" #include "gui/widgets/layout.h" #include "gui/widgets/layouttype.h" +#include "gui/widgets/scrollarea.h" #include "utils/delete2.h" #include "utils/dtor.h" @@ -54,6 +55,8 @@ MailWindow::MailWindow() : mMessagesMap(), mMailModel(new ExtendedNamesModel), mListBox(new ExtendedListBox(this, mMailModel, "extendedlistbox.xml")), + mListScrollArea(new ScrollArea(this, mListBox, + getOptionBool("showlistbackground"), "mail_listbackground.xml")), // TRANSLATORS: mail window button mRefreshButton(new Button(this, _("Refresh"), "refresh", this)), // TRANSLATORS: mail window button @@ -81,10 +84,12 @@ MailWindow::MailWindow() : setMinHeight(179); center(); + mListScrollArea->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER); + ContainerPlacer placer; placer = getPlacer(0, 0); - placer(0, 0, mListBox, 4, 4).setPadding(3); + placer(0, 0, mListScrollArea, 4, 5).setPadding(3); placer(4, 0, mRefreshButton); placer(4, 1, mOpenButton); placer(4, 2, mNewButton); diff --git a/src/gui/windows/mailwindow.h b/src/gui/windows/mailwindow.h index fc5fab397..e1562f074 100644 --- a/src/gui/windows/mailwindow.h +++ b/src/gui/windows/mailwindow.h @@ -30,6 +30,7 @@ class Button; class ExtendedListBox; class ExtendedNamesModel; +class ScrollArea; struct MailMessage; @@ -67,6 +68,7 @@ class MailWindow final : public Window, std::map mMessagesMap; ExtendedNamesModel *mMailModel; ExtendedListBox *mListBox; + ScrollArea *mListScrollArea; Button *mRefreshButton; Button *mNewButton; Button *mDeleteButton; -- cgit v1.2.3-70-g09d2