unified settings of lists headers width

This commit is contained in:
Martin Rotter 2019-04-03 11:45:48 +02:00
parent 8bbff7eb6e
commit 4d1c9810cd
5 changed files with 12 additions and 5 deletions

View File

@ -43,7 +43,7 @@
#define TRAY_ICON_BUBBLE_TIMEOUT 20000 #define TRAY_ICON_BUBBLE_TIMEOUT 20000
#define CLOSE_LOCK_TIMEOUT 500 #define CLOSE_LOCK_TIMEOUT 500
#define DOWNLOAD_TIMEOUT 30000 #define DOWNLOAD_TIMEOUT 30000
#define MESSAGES_VIEW_DEFAULT_COL 170 #define MESSAGES_VIEW_DEFAULT_COL 100
#define MESSAGES_VIEW_MINIMUM_COL 16 #define MESSAGES_VIEW_MINIMUM_COL 16
#define FEEDS_VIEW_COLUMN_COUNT 2 #define FEEDS_VIEW_COLUMN_COUNT 2
#define FEED_DOWNLOADER_MAX_THREADS 3 #define FEED_DOWNLOADER_MAX_THREADS 3

View File

@ -279,6 +279,10 @@ void FeedMessageViewer::initializeViews() {
setTabOrder(m_messagesView, m_toolBarFeeds); setTabOrder(m_messagesView, m_toolBarFeeds);
setTabOrder(m_toolBarFeeds, m_toolBarMessages); setTabOrder(m_toolBarFeeds, m_toolBarMessages);
setTabOrder(m_toolBarMessages, m_messagesBrowser); setTabOrder(m_toolBarMessages, m_messagesBrowser);
// Set initial ratio of sizes.
m_feedSplitter->setStretchFactor(0, 1);
m_feedSplitter->setStretchFactor(1, 3);
} }
void FeedMessageViewer::refreshVisualProperties() { void FeedMessageViewer::refreshVisualProperties() {

View File

@ -29,7 +29,7 @@ class FeedMessageViewer : public TabContent {
Q_OBJECT Q_OBJECT
public: public:
explicit FeedMessageViewer(QWidget* parent = 0); explicit FeedMessageViewer(QWidget* parent = nullptr);
virtual ~FeedMessageViewer(); virtual ~FeedMessageViewer();
#if defined(USE_WEBENGINE) #if defined(USE_WEBENGINE)

View File

@ -554,7 +554,6 @@ void FeedsView::setupAppearance() {
header()->setSectionResizeMode(FDS_MODEL_TITLE_INDEX, QHeaderView::Stretch); header()->setSectionResizeMode(FDS_MODEL_TITLE_INDEX, QHeaderView::Stretch);
header()->setSectionResizeMode(FDS_MODEL_COUNTS_INDEX, QHeaderView::ResizeToContents); header()->setSectionResizeMode(FDS_MODEL_COUNTS_INDEX, QHeaderView::ResizeToContents);
header()->setStretchLastSection(false); header()->setStretchLastSection(false);
header()->setSortIndicatorShown(false);
setUniformRowHeights(true); setUniformRowHeights(true);
setAnimated(true); setAnimated(true);

View File

@ -155,8 +155,7 @@ void MessagesView::setupAppearance() {
header()->setDefaultSectionSize(MESSAGES_VIEW_DEFAULT_COL); header()->setDefaultSectionSize(MESSAGES_VIEW_DEFAULT_COL);
header()->setMinimumSectionSize(MESSAGES_VIEW_MINIMUM_COL); header()->setMinimumSectionSize(MESSAGES_VIEW_MINIMUM_COL);
header()->setCascadingSectionResizes(false); header()->setCascadingSectionResizes(false);
header()->setStretchLastSection(true); header()->setStretchLastSection(false);
header()->setSortIndicatorShown(true);
} }
void MessagesView::focusInEvent(QFocusEvent* event) { void MessagesView::focusInEvent(QFocusEvent* event) {
@ -559,6 +558,11 @@ void MessagesView::adjustColumns() {
header()->setSectionResizeMode(i, QHeaderView::Interactive); header()->setSectionResizeMode(i, QHeaderView::Interactive);
} }
header()->setSectionResizeMode(MSG_DB_TITLE_INDEX, QHeaderView::Stretch);
header()->setSectionResizeMode(MSG_DB_READ_INDEX, QHeaderView::ResizeToContents);
header()->setSectionResizeMode(MSG_DB_IMPORTANT_INDEX, QHeaderView::ResizeToContents);
header()->setSectionResizeMode(MSG_DB_HAS_ENCLOSURES, QHeaderView::ResizeToContents);
// Hide columns. // Hide columns.
hideColumn(MSG_DB_ID_INDEX); hideColumn(MSG_DB_ID_INDEX);
hideColumn(MSG_DB_DELETED_INDEX); hideColumn(MSG_DB_DELETED_INDEX);