mirror of
https://github.com/Rosalie241/RMG.git
synced 2026-07-11 01:24:01 +02:00
more work
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
QTableView
|
||||
{
|
||||
border: none;
|
||||
color: #006600;
|
||||
color: #0096d3;
|
||||
selection-color: #FFFFFF;
|
||||
selection-background-color: #006600;
|
||||
selection-background-color: #0096d3;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ pkg_check_modules(SDL2 REQUIRED sdl2)
|
||||
add_executable(RMG
|
||||
UserInterface/MainWindow.cpp
|
||||
UserInterface/RomBrowserWidget.cpp
|
||||
UserInterface/NoFocusDelegate.cpp
|
||||
Thread/RomSearcherThread.cpp
|
||||
Thread/EmulationThread.cpp
|
||||
M64P/CoreApi.cpp
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "NoFocusDelegate.hpp"
|
||||
|
||||
using namespace UserInterface;
|
||||
|
||||
void NoFocusDelegate::paint(QPainter* painter, const QStyleOptionViewItem & option, const QModelIndex &index) const
|
||||
{
|
||||
QStyleOptionViewItem itemOption(option);
|
||||
if (itemOption.state & QStyle::State_HasFocus)
|
||||
itemOption.state = itemOption.state ^ QStyle::State_HasFocus;
|
||||
QStyledItemDelegate::paint(painter, itemOption, index);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef NOFOCUSDELEGATE_HPP
|
||||
#define NOFOCUSDELEGATE_HPP
|
||||
|
||||
#include <QStyledItemDelegate>
|
||||
|
||||
namespace UserInterface
|
||||
{
|
||||
class NoFocusDelegate : public QStyledItemDelegate
|
||||
{
|
||||
protected:
|
||||
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
};
|
||||
} // namespace UserInterface
|
||||
|
||||
#endif // NOFOCUSDELEGATE_HPP
|
||||
@@ -63,10 +63,15 @@ void RomBrowserWidget::model_LabelList_Setup(void)
|
||||
|
||||
void RomBrowserWidget::widget_Init(void)
|
||||
{
|
||||
this->widget_Delegate = new NoFocusDelegate();
|
||||
|
||||
this->setModel(this->model_Model);
|
||||
this->setItemDelegate(this->widget_Delegate);
|
||||
this->setWordWrap(false);
|
||||
this->setShowGrid(false);
|
||||
this->setSelectionBehavior(QTableView::SelectRows);
|
||||
this->setSortingEnabled(true);
|
||||
this->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
this->setSelectionBehavior(QTableView::SelectRows);
|
||||
|
||||
this->verticalHeader()->hide();
|
||||
|
||||
@@ -75,14 +80,9 @@ void RomBrowserWidget::widget_Init(void)
|
||||
this->horizontalHeader()->setSortIndicatorShown(false);
|
||||
this->horizontalHeader()->setHighlightSections(false);
|
||||
|
||||
this->verticalHeader()->setSectionResizeMode(QHeaderView::Interactive);
|
||||
this->verticalHeader()->setMaximumSectionSize(20);
|
||||
this->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
|
||||
this->column_SetSize();
|
||||
|
||||
QFont f = this->font();
|
||||
f.setPixelSize(11);
|
||||
this->setFont(f);
|
||||
}
|
||||
|
||||
void RomBrowserWidget::rom_Searcher_Init(void)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#ifndef ROMBROWSERWIDGET_HPP
|
||||
#define ROMBROWSERWIDGET_HPP
|
||||
|
||||
#include "NoFocusDelegate.hpp"
|
||||
#include "../Thread/RomSearcherThread.hpp"
|
||||
#include "../Globals.hpp"
|
||||
|
||||
@@ -40,6 +41,7 @@ namespace UserInterface
|
||||
void model_Setup(void);
|
||||
void model_LabelList_Setup(void);
|
||||
|
||||
NoFocusDelegate* widget_Delegate;
|
||||
void widget_Init(void);
|
||||
|
||||
Thread::RomSearcherThread *rom_Searcher_Thread;
|
||||
|
||||
Reference in New Issue
Block a user