Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.3
apper
0017-Fix-bug-that-after-a-refresh-cache-made-th...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0017-Fix-bug-that-after-a-refresh-cache-made-the-package-.patch of Package apper
From cd4e7fc408ebb65d9560d86b285fe8e0ebb5aa77 Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti <dantti12@gmail.com> Date: Fri, 18 Jan 2013 00:56:06 -0200 Subject: [PATCH 17/20] Fix bug that after a refresh cache made the package progress bar of an install/remove/update too wide --- libapper/TransactionDelegate.cpp | 12 ++++++------ libapper/TransactionDelegate.h | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/libapper/TransactionDelegate.cpp b/libapper/TransactionDelegate.cpp index e6e77e5..f60f4f7 100644 --- a/libapper/TransactionDelegate.cpp +++ b/libapper/TransactionDelegate.cpp @@ -30,7 +30,8 @@ using namespace PackageKit; TransactionDelegate::TransactionDelegate(QObject *parent) : - QStyledItemDelegate(parent) + QStyledItemDelegate(parent), + m_minWidth(0) { } @@ -63,8 +64,6 @@ void TransactionDelegate::paint(QPainter *painter, } } -static int minWidth = 0; - QSize TransactionDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { @@ -74,10 +73,11 @@ QSize TransactionDelegate::sizeHint(const QStyleOptionViewItem &option, // The first column keeps resizing // this avoids it being smaller if (index.column() == 0) { - if (size.width() < minWidth) { - size.setWidth(minWidth); + if (size.width() < m_minWidth) { + size.setWidth(m_minWidth); } else { - minWidth = size.width(); + TransactionDelegate *delegate = const_cast<TransactionDelegate*>(this); + delegate->m_minWidth = size.width(); } } return size; diff --git a/libapper/TransactionDelegate.h b/libapper/TransactionDelegate.h index 4868461..747e211 100644 --- a/libapper/TransactionDelegate.h +++ b/libapper/TransactionDelegate.h @@ -31,6 +31,9 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; + +private: + int m_minWidth; }; #endif -- 1.8.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor