mirror of
https://github.com/dolphin-emu/dolphin
synced 2024-06-28 22:46:42 +00:00
Compare commits
6 Commits
f060917595
...
b11d6afbad
Author | SHA1 | Date | |
---|---|---|---|
|
b11d6afbad | ||
|
10a95a4d5b | ||
|
04b0ceedcd | ||
|
9c432e960b | ||
|
f8f117e599 | ||
|
7eab58d0cd |
|
@ -874,7 +874,7 @@ It can efficiently compress both junk data and encrypted Wii data.
|
|||
<string name="about_website"><a href="https://dolphin-emu.org/">Website</a></string>
|
||||
<string name="about_github"><a href="https://github.com/dolphin-emu/dolphin">GitHub</a></string>
|
||||
<string name="about_support"><a href="https://forums.dolphin-emu.org/">Support</a></string>
|
||||
<string name="about_copyright_warning">\u00A9 2003–2015+ Dolphin Team. \u201cGameCube\u201d and \u201cWii\u201d are trademarks of Nintendo. Dolphin is not affiliated with Nintendo in any way.</string>
|
||||
<string name="about_copyright_warning">\u00A9 2003–2024+ Dolphin Team. \u201cGameCube\u201d and \u201cWii\u201d are trademarks of Nintendo. Dolphin is not affiliated with Nintendo in any way.</string>
|
||||
<string name="system_driver">System driver</string>
|
||||
<string name="system_driver_desc">The GPU driver that is part of the OS.</string>
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
|
|||
// in your translation, please use the type of curly quotes that's appropriate for
|
||||
// your language. If you aren't sure which type is appropriate, see
|
||||
// https://en.wikipedia.org/wiki/Quotation_mark#Specific_language_features
|
||||
tr("\u00A9 2003-2015+ Dolphin Team. \u201cGameCube\u201d and \u201cWii\u201d are "
|
||||
tr("\u00A9 2003-2024+ Dolphin Team. \u201cGameCube\u201d and \u201cWii\u201d are "
|
||||
"trademarks of Nintendo. Dolphin is not affiliated with Nintendo in any way.")));
|
||||
|
||||
QLabel* logo = new QLabel();
|
||||
|
|
|
@ -320,6 +320,8 @@ add_executable(dolphin-emu
|
|||
QtUtils/SignalBlocking.h
|
||||
QtUtils/UTF8CodePointCountValidator.cpp
|
||||
QtUtils/UTF8CodePointCountValidator.h
|
||||
QtUtils/ViewportLock.cpp
|
||||
QtUtils/ViewportLock.h
|
||||
QtUtils/WindowActivationEventFilter.cpp
|
||||
QtUtils/WindowActivationEventFilter.h
|
||||
QtUtils/WrapInScrollArea.cpp
|
||||
|
|
|
@ -67,6 +67,7 @@
|
|||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/QtUtils/ParallelProgressDialog.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "DolphinQt/QtUtils/ViewportLock.h"
|
||||
#include "DolphinQt/Resources.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
#include "DolphinQt/WiiUpdate.h"
|
||||
|
@ -116,6 +117,8 @@ GameList::GameList(QWidget* parent) : QStackedWidget(parent), m_model(this)
|
|||
connect(&m_model, &QAbstractItemModel::rowsInserted, this, &GameList::ConsiderViewChange);
|
||||
connect(&m_model, &QAbstractItemModel::rowsRemoved, this, &GameList::ConsiderViewChange);
|
||||
|
||||
m_viewportLock = new ViewportLock(this, m_list_proxy, m_list);
|
||||
|
||||
addWidget(m_list);
|
||||
addWidget(m_grid);
|
||||
addWidget(m_empty);
|
||||
|
|
|
@ -20,6 +20,8 @@ namespace UICommon
|
|||
class GameFile;
|
||||
}
|
||||
|
||||
class ViewportLock;
|
||||
|
||||
class GameList final : public QStackedWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -100,6 +102,7 @@ private:
|
|||
void UpdateFont();
|
||||
|
||||
GameListModel m_model;
|
||||
ViewportLock* m_viewportLock;
|
||||
QSortFilterProxyModel* m_list_proxy;
|
||||
QSortFilterProxyModel* m_grid_proxy;
|
||||
|
||||
|
|
34
Source/Core/DolphinQt/QtUtils/ViewportLock.cpp
Normal file
34
Source/Core/DolphinQt/QtUtils/ViewportLock.cpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
// Copyright 2024 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
#include <QAbstractItemView>
|
||||
|
||||
#include "DolphinQt/QtUtils/ViewportLock.h"
|
||||
|
||||
ViewportLock::ViewportLock(QObject* parent, QAbstractItemModel* model, QAbstractItemView* view)
|
||||
: QObject(parent), m_view(view)
|
||||
{
|
||||
connect(model, &QAbstractItemModel::rowsAboutToBeInserted, this,
|
||||
&ViewportLock::AboutToBeModified);
|
||||
connect(model, &QAbstractItemModel::rowsAboutToBeRemoved, this, &ViewportLock::AboutToBeModified);
|
||||
connect(model, &QAbstractItemModel::rowsInserted, this, &ViewportLock::Modified);
|
||||
connect(model, &QAbstractItemModel::rowsRemoved, this, &ViewportLock::Modified);
|
||||
}
|
||||
|
||||
void ViewportLock::AboutToBeModified()
|
||||
{
|
||||
QSize size = m_view->size();
|
||||
m_first = m_view->indexAt(QPoint(0, 0));
|
||||
m_last = m_view->indexAt(QPoint(size.height(), size.width()));
|
||||
}
|
||||
|
||||
void ViewportLock::Modified()
|
||||
{
|
||||
// Try to keep the first row at the top.
|
||||
// If that fails, try to keep the last row at the bottom.
|
||||
if (m_first.isValid())
|
||||
m_view->scrollTo(m_first, QAbstractItemView::PositionAtTop);
|
||||
else if (m_last.isValid())
|
||||
m_view->scrollTo(m_last, QAbstractItemView::PositionAtBottom);
|
||||
}
|
25
Source/Core/DolphinQt/QtUtils/ViewportLock.h
Normal file
25
Source/Core/DolphinQt/QtUtils/ViewportLock.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Copyright 2024 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QPersistentModelIndex>
|
||||
|
||||
class QAbstractItemModel;
|
||||
class QAbstractItemView;
|
||||
|
||||
// Try to keep visible items in view while items are added/removed.
|
||||
class ViewportLock : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ViewportLock(QObject* parent, QAbstractItemModel* model, QAbstractItemView* view);
|
||||
void AboutToBeModified();
|
||||
void Modified();
|
||||
|
||||
private:
|
||||
QAbstractItemView* m_view;
|
||||
QPersistentModelIndex m_first, m_last;
|
||||
};
|
|
@ -194,7 +194,7 @@ void GeneralPane::CreateAutoUpdate()
|
|||
auto_update_group_layout->addRow(tr("&Auto Update:"), m_combobox_update_track);
|
||||
|
||||
for (const QString& option :
|
||||
{tr("Don't Update"), tr("Beta (once a month)"), tr("Dev (multiple times a day)")})
|
||||
{tr("Don't Update"), tr("Releases (every few months)"), tr("Dev (multiple times a day)")})
|
||||
m_combobox_update_track->addItem(option);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user