[Qt] fix experimental build warning layout and smoothen gamelist scrolling (#3532)

* Qt: fix layout of "experimental build warning" for dpi scaling

and remove compiler warning in welcome_dialog.ui

* Qt: smoothen gamelist/-grid scrolling by setting singlestep value

and fix missing scroll and deselect on gamegrid

* Qt: show all bootable categories in gamegrid
This commit is contained in:
Megamouse 2017-10-05 04:22:02 +02:00 committed by Ivan
parent 0c5cb4824b
commit 0ca1f82059
6 changed files with 31 additions and 8 deletions

View File

@ -12,7 +12,7 @@ class game_list : public QTableWidget
private: private:
void mousePressEvent(QMouseEvent *event) void mousePressEvent(QMouseEvent *event)
{ {
if (!indexAt(event->pos()).isValid()) if (!indexAt(event->pos()).isValid() || itemAt(event->pos())->data(Qt::UserRole) < 0)
{ {
clearSelection(); clearSelection();
} }

View File

@ -153,6 +153,9 @@ game_list_frame::game_list_frame(std::shared_ptr<gui_settings> settings, const R
m_gameList->setSelectionBehavior(QAbstractItemView::SelectRows); m_gameList->setSelectionBehavior(QAbstractItemView::SelectRows);
m_gameList->setSelectionMode(QAbstractItemView::SingleSelection); m_gameList->setSelectionMode(QAbstractItemView::SingleSelection);
m_gameList->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); m_gameList->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
m_gameList->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
m_gameList->verticalScrollBar()->setSingleStep(20);
m_gameList->horizontalScrollBar()->setSingleStep(20);
m_gameList->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed); m_gameList->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed);
m_gameList->verticalHeader()->setMinimumSectionSize(m_Icon_Size.height()); m_gameList->verticalHeader()->setMinimumSectionSize(m_Icon_Size.height());
m_gameList->verticalHeader()->setMaximumSectionSize(m_Icon_Size.height()); m_gameList->verticalHeader()->setMaximumSectionSize(m_Icon_Size.height());
@ -951,7 +954,7 @@ void game_list_frame::resizeEvent(QResizeEvent *event)
{ {
if (!m_isListLayout) if (!m_isListLayout)
{ {
Refresh(); Refresh(false, m_xgrid->selectedItems().count());
} }
QDockWidget::resizeEvent(event); QDockWidget::resizeEvent(event);
} }
@ -1079,10 +1082,7 @@ void game_list_frame::PopulateGameGrid(uint maxCols, const QSize& image_size, co
{ {
continue; continue;
} }
if (category::CategoryInMap(m_game_data[i].info.category, category::cat_boot))
QString category = qstr(m_game_data[i].info.category);
if (category == category::hdd_Game || category == category::disc_Game)
{ {
QString title = GUI::get_Single_Line(qstr(m_game_data[i].info.name)); QString title = GUI::get_Single_Line(qstr(m_game_data[i].info.name));

View File

@ -100,6 +100,16 @@ namespace category // (see PARAM.SFO in psdevwiki.com) TODO: Disc Categories
const QStringList media = { app_Photo, app_Video, bc_Video, app_Music, app_TV, web_TV }; const QStringList media = { app_Photo, app_Video, bc_Video, app_Music, app_TV, web_TV };
const QStringList data = { ps3_Data, ps2_Data, ps3_Save, psp_Save }; const QStringList data = { ps3_Data, ps2_Data, ps3_Save, psp_Save };
const QStringList others = { network, store_FE, trophy, other }; const QStringList others = { network, store_FE, trophy, other };
inline bool CategoryInMap(const std::string& cat, const q_from_char& map)
{
auto map_contains_category = [cat](std::pair<std::string, const QString> p)
{
return p.second == qstr(cat);
};
return std::find_if(map.begin(), map.end(), map_contains_category) != map.end();
}
} }
namespace parental namespace parental

View File

@ -4,6 +4,7 @@
#include <QHeaderView> #include <QHeaderView>
#include <QLabel> #include <QLabel>
#include <QScrollBar>
game_list_grid::game_list_grid(const QSize& icon_size, const QColor& icon_color, const qreal& margin_factor, const qreal& text_factor, const bool& showText) game_list_grid::game_list_grid(const QSize& icon_size, const QColor& icon_color, const qreal& margin_factor, const qreal& text_factor, const bool& showText)
: game_list(), m_icon_size(icon_size), m_icon_color(icon_color), m_margin_factor(margin_factor), m_text_factor(text_factor), m_text_enabled(showText) : game_list(), m_icon_size(icon_size), m_icon_color(icon_color), m_margin_factor(margin_factor), m_text_factor(text_factor), m_text_enabled(showText)
@ -28,6 +29,8 @@ game_list_grid::game_list_grid(const QSize& icon_size, const QColor& icon_color,
setSelectionMode(QAbstractItemView::SingleSelection); setSelectionMode(QAbstractItemView::SingleSelection);
setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel); setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
verticalScrollBar()->setSingleStep(20);
horizontalScrollBar()->setSingleStep(20);
setContextMenuPolicy(Qt::CustomContextMenu); setContextMenuPolicy(Qt::CustomContextMenu);
verticalHeader()->setVisible(false); verticalHeader()->setVisible(false);
horizontalHeader()->setVisible(false); horizontalHeader()->setVisible(false);

View File

@ -132,9 +132,20 @@ void main_window::Init()
msg.setWindowIcon(m_appIcon); msg.setWindowIcon(m_appIcon);
msg.setIcon(QMessageBox::Critical); msg.setIcon(QMessageBox::Critical);
msg.setTextFormat(Qt::RichText); msg.setTextFormat(Qt::RichText);
msg.setText("Please understand that this build is not an official RPCS3 release.<br>This build contains changes that may break games, or even <b>damage</b> your data.<br>It's recommended to download and use the official build from <a href='https://rpcs3.net/download'>RPCS3 website</a>.<br><br>Build origin: " STRINGIZE(BRANCH) "<br>Do you wish to use this build anyway?");
msg.setStandardButtons(QMessageBox::Yes | QMessageBox::No); msg.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msg.setDefaultButton(QMessageBox::No); msg.setDefaultButton(QMessageBox::No);
msg.setText(QString(
R"(
<p style="white-space: nowrap;">
Please understand that this build is not an official RPCS3 release.<br>
This build contains changes that may break games, or even <b>damage</b> your data.<br>
We recommend to download and use the official build from the <a href='https://rpcs3.net/download'>RPCS3 website</a>.<br><br>
Build origin: %1<br>
Do you wish to use this build anyway?
</p>
)"
).arg(STRINGIZE(BRANCH)));
msg.layout()->setSizeConstraint(QLayout::SetFixedSize);
if (msg.exec() == QMessageBox::No) if (msg.exec() == QMessageBox::No)
{ {

View File

@ -152,7 +152,6 @@
</layout> </layout>
</item> </item>
</layout> </layout>
<zorder></zorder>
</widget> </widget>
</item> </item>
<item> <item>