@@ -27,7 +27,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: msys2/setup-msys2@v2
|
- uses: msys2/setup-msys2@v2
|
||||||
with:
|
with:
|
||||||
install: base-devel ${{ matrix.prefix }}-toolchain ${{ matrix.prefix }}-qt5-base ${{ matrix.prefix }}-libxml2 git unzip p7zip
|
install: base-devel ${{ matrix.prefix }}-toolchain ${{ matrix.prefix }}-qt5-base ${{ matrix.prefix }}-qt5-svg ${{ matrix.prefix }}-libxml2 git unzip p7zip
|
||||||
msystem: ${{ matrix.msystem }}
|
msystem: ${{ matrix.msystem }}
|
||||||
path-type: minimal
|
path-type: minimal
|
||||||
release: false
|
release: false
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ environment:
|
|||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- qt5
|
- qt5
|
||||||
|
- qt5-svg
|
||||||
- glib
|
- glib
|
||||||
- libxml2 >= 2.0.0
|
- libxml2 >= 2.0.0
|
||||||
- zlib >= 1.2.0 (for archivezip module)
|
- zlib >= 1.2.0 (for archivezip module)
|
||||||
@@ -75,9 +76,9 @@ environment:
|
|||||||
- from MSYS2 MINGW32 or MSYS2 MINGW64 shell:
|
- from MSYS2 MINGW32 or MSYS2 MINGW64 shell:
|
||||||
pacman -S --needed base-devel
|
pacman -S --needed base-devel
|
||||||
32 bit:
|
32 bit:
|
||||||
pacman -S --needed mingw-w64-i686-{toolchain,qt5-base,libxml2}
|
pacman -S --needed mingw-w64-i686-{toolchain,qt5-base,qt5-svg,libxml2}
|
||||||
64 bit:
|
64 bit:
|
||||||
pacman -S --needed mingw-w64-x86_64-{toolchain,qt5-base,libxml2}
|
pacman -S --needed mingw-w64-x86_64-{toolchain,qt5-base,qt5-svg,libxml2}
|
||||||
these are only strictly required for gamepacks:
|
these are only strictly required for gamepacks:
|
||||||
pacman -S --needed unzip svn git
|
pacman -S --needed unzip svn git
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,10 @@ CPPFLAGS_QTWIDGETS ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) Qt
|
|||||||
LIBS_QTWIDGETS ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) Qt5Widgets --libs-only-L --libs-only-l $(STDERR_TO_DEVNULL))
|
LIBS_QTWIDGETS ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) Qt5Widgets --libs-only-L --libs-only-l $(STDERR_TO_DEVNULL))
|
||||||
CPPFLAGS_QTWIDGETS := $(CPPFLAGS_QTWIDGETS)
|
CPPFLAGS_QTWIDGETS := $(CPPFLAGS_QTWIDGETS)
|
||||||
LIBS_QTWIDGETS := $(LIBS_QTWIDGETS)
|
LIBS_QTWIDGETS := $(LIBS_QTWIDGETS)
|
||||||
|
CPPFLAGS_QTSVG ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) Qt5Svg --cflags $(STDERR_TO_DEVNULL)) -DQT_NO_KEYWORDS
|
||||||
|
LIBS_QTSVG ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) Qt5Svg --libs-only-L --libs-only-l $(STDERR_TO_DEVNULL))
|
||||||
|
CPPFLAGS_QTSVG := $(CPPFLAGS_QTSVG)
|
||||||
|
LIBS_QTSVG := $(LIBS_QTSVG)
|
||||||
CPPFLAGS_GL ?=
|
CPPFLAGS_GL ?=
|
||||||
LIBS_GL ?= -lGL # -lopengl32 on Win32
|
LIBS_GL ?= -lGL # -lopengl32 on Win32
|
||||||
CPPFLAGS_DL ?=
|
CPPFLAGS_DL ?=
|
||||||
@@ -387,6 +391,7 @@ dependencies-check:
|
|||||||
checkheader Qt5Core QCoreApplication QCoreApplication::exec "$(CPPFLAGS_QTCORE)" "$(LIBS_QTCORE)"; \
|
checkheader Qt5Core QCoreApplication QCoreApplication::exec "$(CPPFLAGS_QTCORE)" "$(LIBS_QTCORE)"; \
|
||||||
checkheader Qt5Gui QGuiApplication QGuiApplication::exec "$(CPPFLAGS_QTGUI)" "$(LIBS_QTGUI)"; \
|
checkheader Qt5Gui QGuiApplication QGuiApplication::exec "$(CPPFLAGS_QTGUI)" "$(LIBS_QTGUI)"; \
|
||||||
checkheader Qt5Widgets QApplication QApplication::exec "$(CPPFLAGS_QTWIDGETS)" "$(LIBS_QTWIDGETS)"; \
|
checkheader Qt5Widgets QApplication QApplication::exec "$(CPPFLAGS_QTWIDGETS)" "$(LIBS_QTWIDGETS)"; \
|
||||||
|
checkheader Qt5Svg QSvgWidget QSvgWidget::mouseGrabber "$(CPPFLAGS_QTSVG)" "$(LIBS_QTSVG)"; \
|
||||||
[ "$(OS)" != "Win32" ] && checkheader libc6-dev dlfcn.h dlopen "$(CPPFLAGS_DL)" "$(LIBS_DL)"; \
|
[ "$(OS)" != "Win32" ] && checkheader libc6-dev dlfcn.h dlopen "$(CPPFLAGS_DL)" "$(LIBS_DL)"; \
|
||||||
checkheader zlib1g-dev zlib.h zlibVersion "$(CPPFLAGS_ZLIB)" "$(LIBS_ZLIB)"; \
|
checkheader zlib1g-dev zlib.h zlibVersion "$(CPPFLAGS_ZLIB)" "$(LIBS_ZLIB)"; \
|
||||||
[ "$$failed" = "0" ] && $(ECHO) All required libraries have been found!
|
[ "$$failed" = "0" ] && $(ECHO) All required libraries have been found!
|
||||||
@@ -841,8 +846,8 @@ libetclib.$(A): \
|
|||||||
libs/etclib.o \
|
libs/etclib.o \
|
||||||
|
|
||||||
$(INSTALLDIR)/radiant.$(EXE): LDFLAGS_EXTRA := $(MWINDOWS)
|
$(INSTALLDIR)/radiant.$(EXE): LDFLAGS_EXTRA := $(MWINDOWS)
|
||||||
$(INSTALLDIR)/radiant.$(EXE): LIBS_EXTRA := $(LIBS_GL) $(LIBS_DL) $(LIBS_XML) $(LIBS_GLIB) $(LIBS_QTWIDGETS) $(LIBS_ZLIB)
|
$(INSTALLDIR)/radiant.$(EXE): LIBS_EXTRA := $(LIBS_GL) $(LIBS_DL) $(LIBS_XML) $(LIBS_GLIB) $(LIBS_QTWIDGETS) $(LIBS_QTSVG) $(LIBS_ZLIB)
|
||||||
$(INSTALLDIR)/radiant.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_GL) $(CPPFLAGS_DL) $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_QTWIDGETS) -Ilibs -Iinclude
|
$(INSTALLDIR)/radiant.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_GL) $(CPPFLAGS_DL) $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_QTWIDGETS) $(CPPFLAGS_QTSVG) -Ilibs -Iinclude
|
||||||
$(INSTALLDIR)/radiant.$(EXE): \
|
$(INSTALLDIR)/radiant.$(EXE): \
|
||||||
radiant/autosave.o \
|
radiant/autosave.o \
|
||||||
radiant/brushmanip.o \
|
radiant/brushmanip.o \
|
||||||
|
|||||||
@@ -1138,6 +1138,7 @@ misc...
|
|||||||
* build menu.customize.build variables: are editable
|
* build menu.customize.build variables: are editable
|
||||||
* layers system (stored in comments of .map file)
|
* layers system (stored in comments of .map file)
|
||||||
* Layers Browser: New Layer, Show All Layers, Hide All Layers buttons
|
* Layers Browser: New Layer, Show All Layers, Hide All Layers buttons
|
||||||
|
* new icons by Julius, high dpi scaling support
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ for EXTRAPATH in \
|
|||||||
'./share/qt5/plugins/imageformats/*.dll' \
|
'./share/qt5/plugins/imageformats/*.dll' \
|
||||||
'./share/qt5/plugins/platforms/*.dll' \
|
'./share/qt5/plugins/platforms/*.dll' \
|
||||||
'./share/qt5/plugins/styles/*.dll' \
|
'./share/qt5/plugins/styles/*.dll' \
|
||||||
|
'./share/qt5/plugins/iconengines/*.dll' \
|
||||||
; do
|
; do
|
||||||
cp --parent -v `find $EXTRAPATH -type f` "$INSTALLDIR"
|
cp --parent -v `find $EXTRAPATH -type f` "$INSTALLDIR"
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -21,9 +21,10 @@
|
|||||||
|
|
||||||
#include "image.h"
|
#include "image.h"
|
||||||
|
|
||||||
|
#include "os/file.h"
|
||||||
|
#include "os/path.h"
|
||||||
#include "string/string.h"
|
#include "string/string.h"
|
||||||
#include "stream/stringstream.h"
|
#include "stream/stringstream.h"
|
||||||
#include "stream/textstream.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
@@ -36,11 +37,21 @@ void BitmapsPath_set( const char* path ){
|
|||||||
}
|
}
|
||||||
|
|
||||||
QPixmap new_local_image( const char* filename ){
|
QPixmap new_local_image( const char* filename ){
|
||||||
const auto fullPath = StringStream( g_bitmapsPath, filename );
|
StringOutputStream fullpath( 256 );
|
||||||
return QPixmap( QString( fullPath.c_str() ) );
|
|
||||||
|
for( const auto *ext : { ".svg", ".png" } )
|
||||||
|
if( file_exists( fullpath( g_bitmapsPath, PathExtensionless( filename ), ext ) ) )
|
||||||
|
return QPixmap( fullpath.c_str() );
|
||||||
|
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon new_local_icon( const char* filename ){
|
QIcon new_local_icon( const char* filename ){
|
||||||
const auto fullPath = StringStream( g_bitmapsPath, filename );
|
StringOutputStream fullpath( 256 );
|
||||||
return QIcon( fullPath.c_str() );
|
|
||||||
|
for( const auto *ext : { ".svg", ".png", ".ico" } )
|
||||||
|
if( file_exists( fullpath( g_bitmapsPath, PathExtensionless( filename ), ext ) ) )
|
||||||
|
return QIcon( fullpath.c_str() );
|
||||||
|
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1367,6 +1367,7 @@ void CSG_DeleteComponents(){
|
|||||||
#include <QButtonGroup>
|
#include <QButtonGroup>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
|
#include <QStyle>
|
||||||
|
|
||||||
struct CSGToolDialog
|
struct CSGToolDialog
|
||||||
{
|
{
|
||||||
@@ -1517,24 +1518,22 @@ void CSG_Tool(){
|
|||||||
|
|
||||||
radFaces->setChecked( true );
|
radFaces->setChecked( true );
|
||||||
}
|
}
|
||||||
{
|
auto newCheckButton = []( const char *icon, const char *tooltip ){
|
||||||
auto *button = g_csgtool_dialog.caulk = new QToolButton;
|
auto *button = new QToolButton;
|
||||||
auto pix = new_local_image( "f-caulk.png" );
|
const int iconSize = button->style()->pixelMetric( QStyle::PixelMetric::PM_ToolBarIconSize );
|
||||||
button->setIcon( pix );
|
button->setIconSize( QSize( iconSize, iconSize ) );
|
||||||
button->setIconSize( pix.size() + QSize( 8, 8 ) );
|
button->setIcon( new_local_icon( icon ) );
|
||||||
button->setToolTip( "Caulk some faces" );
|
button->setToolTip( tooltip );
|
||||||
button->setCheckable( true );
|
button->setCheckable( true );
|
||||||
button->setChecked( true );
|
button->setChecked( true );
|
||||||
|
return button;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
auto *button = g_csgtool_dialog.caulk = newCheckButton( "f-caulk.png", "Caulk some faces" );
|
||||||
grid->addWidget( button, 0, 6 );
|
grid->addWidget( button, 0, 6 );
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto *button = g_csgtool_dialog.removeInner = new QToolButton;
|
auto *button = g_csgtool_dialog.removeInner = newCheckButton( "csgtool_removeinner.png", "Remove inner brush" );
|
||||||
auto pix = new_local_image( "csgtool_removeinner.png" );
|
|
||||||
button->setIcon( pix );
|
|
||||||
button->setIconSize( pix.size() + QSize( 8, 8 ) );
|
|
||||||
button->setToolTip( "Remove inner brush" );
|
|
||||||
button->setCheckable( true );
|
|
||||||
button->setChecked( true );
|
|
||||||
grid->addWidget( button, 0, 7 );
|
grid->addWidget( button, 0, 7 );
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@@ -1543,57 +1542,41 @@ void CSG_Tool(){
|
|||||||
line->setFrameShadow( QFrame::Shadow::Raised );
|
line->setFrameShadow( QFrame::Shadow::Raised );
|
||||||
grid->addWidget( line, 1, 0, 1, 8 );
|
grid->addWidget( line, 1, 0, 1, 8 );
|
||||||
}
|
}
|
||||||
{
|
auto newButton = []( const char *icon, const char *tooltip ){
|
||||||
auto *button = new QToolButton;
|
auto *button = new QToolButton;
|
||||||
auto pix = new_local_image( "csgtool_shrink.png" );
|
const int iconSize = button->style()->pixelMetric( QStyle::PixelMetric::PM_LargeIconSize );
|
||||||
button->setIcon( pix );
|
button->setIconSize( QSize( iconSize, iconSize ) );
|
||||||
button->setIconSize( pix.size() + QSize( 8, 8 ) );
|
button->setIcon( new_local_icon( icon ) );
|
||||||
button->setToolTip( "Shrink brush" );
|
button->setToolTip( tooltip );
|
||||||
|
return button;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
auto *button = newButton( "csgtool_shrink.png", "Shrink brush" );
|
||||||
grid->addWidget( button, 2, 0 );
|
grid->addWidget( button, 2, 0 );
|
||||||
QObject::connect( button, &QAbstractButton::clicked, CSGdlg_BrushShrink );
|
QObject::connect( button, &QAbstractButton::clicked, CSGdlg_BrushShrink );
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto *button = new QToolButton;
|
auto *button = newButton( "csgtool_expand.png", "Expand brush" );
|
||||||
auto pix = new_local_image( "csgtool_expand.png" );
|
|
||||||
button->setIcon( pix );
|
|
||||||
button->setIconSize( pix.size() + QSize( 8, 8 ) );
|
|
||||||
button->setToolTip( "Expand brush" );
|
|
||||||
grid->addWidget( button, 2, 1 );
|
grid->addWidget( button, 2, 1 );
|
||||||
QObject::connect( button, &QAbstractButton::clicked, CSGdlg_BrushExpand );
|
QObject::connect( button, &QAbstractButton::clicked, CSGdlg_BrushExpand );
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto *button = new QToolButton;
|
auto *button = newButton( "csgtool_diagonal.png", "Hollow::diagonal joints" );
|
||||||
auto pix = new_local_image( "csgtool_diagonal.png" );
|
|
||||||
button->setIcon( pix );
|
|
||||||
button->setIconSize( pix.size() + QSize( 8, 8 ) );
|
|
||||||
button->setToolTip( "Hollow::diagonal joints" );
|
|
||||||
grid->addWidget( button, 2, 3 );
|
grid->addWidget( button, 2, 3 );
|
||||||
QObject::connect( button, &QAbstractButton::clicked, [](){ CSG_Hollow( eDiag, "brushHollow::Diag", g_csgtool_dialog ); } );
|
QObject::connect( button, &QAbstractButton::clicked, [](){ CSG_Hollow( eDiag, "brushHollow::Diag", g_csgtool_dialog ); } );
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto *button = new QToolButton;
|
auto *button = newButton( "csgtool_wrap.png", "Hollow::wrap" );
|
||||||
auto pix = new_local_image( "csgtool_wrap.png" );
|
|
||||||
button->setIcon( pix );
|
|
||||||
button->setIconSize( pix.size() + QSize( 8, 8 ) );
|
|
||||||
button->setToolTip( "Hollow::wrap" );
|
|
||||||
grid->addWidget( button, 2, 4 );
|
grid->addWidget( button, 2, 4 );
|
||||||
QObject::connect( button, &QAbstractButton::clicked, [](){ CSG_Hollow( eWrap, "brushHollow::Wrap", g_csgtool_dialog ); } );
|
QObject::connect( button, &QAbstractButton::clicked, [](){ CSG_Hollow( eWrap, "brushHollow::Wrap", g_csgtool_dialog ); } );
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto *button = new QToolButton;
|
auto *button = newButton( "csgtool_extrude.png", "Hollow::extrude faces" );
|
||||||
auto pix = new_local_image( "csgtool_extrude.png" );
|
|
||||||
button->setIcon( pix );
|
|
||||||
button->setIconSize( pix.size() + QSize( 8, 8 ) );
|
|
||||||
button->setToolTip( "Hollow::extrude faces" );
|
|
||||||
grid->addWidget( button, 2, 5 );
|
grid->addWidget( button, 2, 5 );
|
||||||
QObject::connect( button, &QAbstractButton::clicked, [](){ CSG_Hollow( eExtrude, "brushHollow::Extrude", g_csgtool_dialog ); } );
|
QObject::connect( button, &QAbstractButton::clicked, [](){ CSG_Hollow( eExtrude, "brushHollow::Extrude", g_csgtool_dialog ); } );
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto *button = new QToolButton;
|
auto *button = newButton( "csgtool_pull.png", "Hollow::pull faces" );
|
||||||
auto pix = new_local_image( "csgtool_pull.png" );
|
|
||||||
button->setIcon( pix );
|
|
||||||
button->setIconSize( pix.size() + QSize( 8, 8 ) );
|
|
||||||
button->setToolTip( "Hollow::pull faces" );
|
|
||||||
grid->addWidget( button, 2, 6 );
|
grid->addWidget( button, 2, 6 );
|
||||||
QObject::connect( button, &QAbstractButton::clicked, [](){ CSG_Hollow( ePull, "brushHollow::Pull", g_csgtool_dialog ); } );
|
QObject::connect( button, &QAbstractButton::clicked, [](){ CSG_Hollow( ePull, "brushHollow::Pull", g_csgtool_dialog ); } );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -459,7 +459,10 @@ void Dialog::addRadioIcons( QGridLayout* grid, const char* name, StringArrayRang
|
|||||||
for ( size_t i = 0; i < icons.size(); ++i )
|
for ( size_t i = 0; i < icons.size(); ++i )
|
||||||
{
|
{
|
||||||
auto *label = new QLabel;
|
auto *label = new QLabel;
|
||||||
label->setPixmap( new_local_image( icons[i] ) );
|
auto pixmap = new_local_image( icons[i] );
|
||||||
|
pixmap.setDevicePixelRatio( label->devicePixelRatio() );
|
||||||
|
// target 0.5 of the image size; has only usecase atm
|
||||||
|
label->setPixmap( pixmap.scaledToHeight( pixmap.height() * label->devicePixelRatio() * pixmap.logicalDpiX() / ( 96 * 2 ), Qt::TransformationMode::SmoothTransformation ) );
|
||||||
subgrid->addWidget( label, 0, i, Qt::AlignmentFlag::AlignHCenter );
|
subgrid->addWidget( label, 0, i, Qt::AlignmentFlag::AlignHCenter );
|
||||||
|
|
||||||
auto *button = new QRadioButton;
|
auto *button = new QRadioButton;
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ void create_filter_toolbar( QToolBar *toolbar ){
|
|||||||
button = toolbar_append_toggle_button( toolbar, "Func_Groups\nRightClick: create func_group", "f-funcgroups.png", "FilterFuncGroups" );
|
button = toolbar_append_toggle_button( toolbar, "Func_Groups\nRightClick: create func_group", "f-funcgroups.png", "FilterFuncGroups" );
|
||||||
g_filter_toolbar_handler.m_actions.emplace( button, new CommonFunc_group );
|
g_filter_toolbar_handler.m_actions.emplace( button, new CommonFunc_group );
|
||||||
|
|
||||||
toolbar_append_toggle_button( toolbar, "Patches", "patch_wireframe.png", "FilterPatches" );
|
toolbar_append_toggle_button( toolbar, "Patches", "f-patches.png", "FilterPatches" );
|
||||||
toolbar->addSeparator();
|
toolbar->addSeparator();
|
||||||
|
|
||||||
// if ( g_pGameDescription->mGameType == "doom3" ) {
|
// if ( g_pGameDescription->mGameType == "doom3" ) {
|
||||||
@@ -173,7 +173,7 @@ void create_filter_toolbar( QToolBar *toolbar ){
|
|||||||
//toolbar_append_toggle_button( toolbar, "Paths", "texture_lock.png", "FilterPaths" );
|
//toolbar_append_toggle_button( toolbar, "Paths", "texture_lock.png", "FilterPaths" );
|
||||||
toolbar->addSeparator();
|
toolbar->addSeparator();
|
||||||
toolbar_append_toggle_button( toolbar, "Entities", "f-entities.png", "FilterEntities" );
|
toolbar_append_toggle_button( toolbar, "Entities", "f-entities.png", "FilterEntities" );
|
||||||
toolbar_append_toggle_button( toolbar, "Point Entities", "status_entity.png", "FilterPointEntities" );
|
toolbar_append_toggle_button( toolbar, "Point Entities", "f-pointentities.png", "FilterPointEntities" );
|
||||||
toolbar_append_toggle_button( toolbar, "Lights", "f-lights.png", "FilterLights" );
|
toolbar_append_toggle_button( toolbar, "Lights", "f-lights.png", "FilterLights" );
|
||||||
toolbar_append_toggle_button( toolbar, "Models", "f-models.png", "FilterModels" );
|
toolbar_append_toggle_button( toolbar, "Models", "f-models.png", "FilterModels" );
|
||||||
|
|
||||||
|
|||||||
@@ -339,7 +339,10 @@ void DoAbout(){
|
|||||||
vbox->addLayout( hbox );
|
vbox->addLayout( hbox );
|
||||||
{
|
{
|
||||||
auto *label = new QLabel;
|
auto *label = new QLabel;
|
||||||
label->setPixmap( new_local_image( "logo.png" ) );
|
auto pixmap = new_local_image( "logo.png" );
|
||||||
|
pixmap.setDevicePixelRatio( label->devicePixelRatio() );
|
||||||
|
// target 0.5 of the image size
|
||||||
|
label->setPixmap( pixmap.scaledToHeight( pixmap.height() * label->devicePixelRatio() * pixmap.logicalDpiX() / ( 96 * 2 ), Qt::TransformationMode::SmoothTransformation ) );
|
||||||
hbox->addWidget( label );
|
hbox->addWidget( label );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -507,7 +507,7 @@ class QWidget* LayersBrowser_constructWindow( QWidget* toplevel ){
|
|||||||
tree->setHeaderHidden( true );
|
tree->setHeaderHidden( true );
|
||||||
tree->setAutoScroll( true );
|
tree->setAutoScroll( true );
|
||||||
tree->setAlternatingRowColors( true );
|
tree->setAlternatingRowColors( true );
|
||||||
const int iconSize = tree->style()->pixelMetric( QStyle::PixelMetric::PM_SmallIconSize, nullptr, tree ) * 1.3;
|
const int iconSize = tree->style()->pixelMetric( QStyle::PixelMetric::PM_SmallIconSize ) * 1.3;
|
||||||
tree->setIconSize( QSize( iconSize, iconSize) );
|
tree->setIconSize( QSize( iconSize, iconSize) );
|
||||||
// tree->setStyleSheet( "QTreeWidget::item { border-bottom: 1px solid gray; }" );
|
// tree->setStyleSheet( "QTreeWidget::item { border-bottom: 1px solid gray; }" );
|
||||||
tree->setDragDropMode( QAbstractItemView::DragDropMode::InternalMove );
|
tree->setDragDropMode( QAbstractItemView::DragDropMode::InternalMove );
|
||||||
|
|||||||
@@ -416,6 +416,10 @@ int main( int argc, char* argv[] ){
|
|||||||
|
|
||||||
glwidget_setDefaultFormat(); // must go before QApplication instantiation
|
glwidget_setDefaultFormat(); // must go before QApplication instantiation
|
||||||
|
|
||||||
|
QCoreApplication::setAttribute( Qt::AA_EnableHighDpiScaling );
|
||||||
|
// QGuiApplication::setHighDpiScaleFactorRoundingPolicy( Qt::HighDpiScaleFactorRoundingPolicy::PassThrough );
|
||||||
|
QCoreApplication::setAttribute( Qt::AA_UseHighDpiPixmaps );
|
||||||
|
|
||||||
QApplication qapplication( argc, argv );
|
QApplication qapplication( argc, argv );
|
||||||
setlocale( LC_NUMERIC, "C" );
|
setlocale( LC_NUMERIC, "C" );
|
||||||
qInstallMessageHandler( qute_messageHandler );
|
qInstallMessageHandler( qute_messageHandler );
|
||||||
|
|||||||
@@ -1383,7 +1383,10 @@ void Manipulators_constructToolbar( QToolBar* toolbar ){
|
|||||||
toolbar_append_toggle_button( toolbar, "UV Tool", "select_mouseuv.png", "MouseUV" );
|
toolbar_append_toggle_button( toolbar, "UV Tool", "select_mouseuv.png", "MouseUV" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <QSvgGenerator>
|
||||||
void create_main_toolbar( QToolBar *toolbar, MainFrame::EViewStyle style ){
|
void create_main_toolbar( QToolBar *toolbar, MainFrame::EViewStyle style ){
|
||||||
|
QSvgGenerator dummy; // reference symbol, so that Qt5Svg.dll required dependency is explicit, also install-dlls-msys2-mingw.sh will find it
|
||||||
|
|
||||||
File_constructToolbar( toolbar );
|
File_constructToolbar( toolbar );
|
||||||
toolbar->addSeparator();
|
toolbar->addSeparator();
|
||||||
|
|
||||||
@@ -1454,10 +1457,12 @@ void create_main_statusbar( QStatusBar *statusbar, QLabel *pStatusLabel[c_status
|
|||||||
auto *hbox = new QHBoxLayout( widget );
|
auto *hbox = new QHBoxLayout( widget );
|
||||||
hbox->setMargin( 0 );
|
hbox->setMargin( 0 );
|
||||||
statusbar->addPermanentWidget( widget, 0 );
|
statusbar->addPermanentWidget( widget, 0 );
|
||||||
const char* imgs[3] = { "status_brush.png", "patch_wireframe.png", "status_entity.png" };
|
const char* imgs[3] = { "status_brush.png", "status_patch.png", "status_entity.png" };
|
||||||
for( ; i < c_status_brushcount + 3; ++i ){
|
for( ; i < c_status_brushcount + 3; ++i ){
|
||||||
auto *label = new QLabel();
|
auto *label = new QLabel();
|
||||||
label->setPixmap( new_local_image( imgs[i - c_status_brushcount] ) );
|
auto pixmap = new_local_image( imgs[i - c_status_brushcount] );
|
||||||
|
pixmap.setDevicePixelRatio( label->devicePixelRatio() );
|
||||||
|
label->setPixmap( pixmap.scaledToHeight( 16 * label->devicePixelRatio() * label->logicalDpiX() / 96, Qt::TransformationMode::SmoothTransformation ) );
|
||||||
hbox->addWidget( label );
|
hbox->addWidget( label );
|
||||||
|
|
||||||
label = new QLabel();
|
label = new QLabel();
|
||||||
|
|||||||
@@ -1283,8 +1283,10 @@ QWidget* ModelBrowser_constructWindow( QWidget* toplevel ){
|
|||||||
{ // menu bar
|
{ // menu bar
|
||||||
auto *toolbar = new QToolBar;
|
auto *toolbar = new QToolBar;
|
||||||
vbox->addWidget( toolbar );
|
vbox->addWidget( toolbar );
|
||||||
|
const int iconSize = toolbar->style()->pixelMetric( QStyle::PixelMetric::PM_SmallIconSize );
|
||||||
|
toolbar->setIconSize( QSize( iconSize, iconSize ) );
|
||||||
|
|
||||||
toolbar_append_button( toolbar, "Reload Model Folders Tree View", "texbro_refresh.png", FreeCaller<void(), ModelBrowser_constructTree>() );
|
toolbar_append_button( toolbar, "Reload Model Folders Tree View", "refresh_modelstree.png", FreeCaller<void(), ModelBrowser_constructTree>() );
|
||||||
}
|
}
|
||||||
{ // TreeView
|
{ // TreeView
|
||||||
g_ModelBrowser.m_treeView = new TexBro_QTreeView;
|
g_ModelBrowser.m_treeView = new TexBro_QTreeView;
|
||||||
|
|||||||
@@ -952,7 +952,10 @@ void DoCapDlg(){
|
|||||||
for( size_t i = 0; i < std::size( iconlabel ); ++i ){
|
for( size_t i = 0; i < std::size( iconlabel ); ++i ){
|
||||||
const auto [ stricon, strlabel ] = iconlabel[i];
|
const auto [ stricon, strlabel ] = iconlabel[i];
|
||||||
auto *label = new QLabel;
|
auto *label = new QLabel;
|
||||||
label->setPixmap( new_local_image( stricon ) );
|
const int iconSize = label->style()->pixelMetric( QStyle::PixelMetric::PM_LargeIconSize );
|
||||||
|
auto pixmap = new_local_image( stricon );
|
||||||
|
pixmap.setDevicePixelRatio( label->devicePixelRatio() );
|
||||||
|
label->setPixmap( pixmap.scaledToHeight( iconSize * label->devicePixelRatio(), Qt::TransformationMode::SmoothTransformation ) );
|
||||||
auto *button = new QRadioButton( strlabel );
|
auto *button = new QRadioButton( strlabel );
|
||||||
group->addButton( button, i ); // set ids 0+, default ones are negative
|
group->addButton( button, i ); // set ids 0+, default ones are negative
|
||||||
form->addRow( label, button );
|
form->addRow( label, button );
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include "stream/stringstream.h"
|
#include "stream/stringstream.h"
|
||||||
#include "os/file.h"
|
#include "os/file.h"
|
||||||
|
#include "os/path.h"
|
||||||
#include <QToolBar>
|
#include <QToolBar>
|
||||||
|
|
||||||
#include "mainframe.h"
|
#include "mainframe.h"
|
||||||
@@ -35,17 +36,12 @@
|
|||||||
QIcon new_plugin_icon( const char* filename ){
|
QIcon new_plugin_icon( const char* filename ){
|
||||||
StringOutputStream fullpath( 256 );
|
StringOutputStream fullpath( 256 );
|
||||||
|
|
||||||
fullpath( AppPath_get(), g_pluginsDir, "bitmaps/", filename );
|
const char *rootdir[][ 2 ] = { { AppPath_get(), g_pluginsDir }, { GameToolsPath_get(), g_pluginsDir }, { AppPath_get(), g_modulesDir } };
|
||||||
if( file_exists( fullpath ) )
|
|
||||||
return QIcon( fullpath.c_str() );
|
|
||||||
|
|
||||||
fullpath( GameToolsPath_get(), g_pluginsDir, "bitmaps/", filename );
|
for( const auto [ root, dir ] : rootdir )
|
||||||
if( file_exists( fullpath ) )
|
for( const auto *ext : { ".svg", ".png" } )
|
||||||
return QIcon( fullpath.c_str() );
|
if( file_exists( fullpath( root, dir, "bitmaps/", PathExtensionless( filename ), ext ) ) )
|
||||||
|
return QIcon( fullpath.c_str() );
|
||||||
fullpath( AppPath_get(), g_modulesDir, "bitmaps/", filename );
|
|
||||||
if( file_exists( fullpath ) )
|
|
||||||
return QIcon( fullpath.c_str() );
|
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1775,6 +1775,8 @@ QWidget* TextureBrowser_constructWindow( QWidget* toplevel ){
|
|||||||
{ // menu bar
|
{ // menu bar
|
||||||
auto *toolbar = new QToolBar;
|
auto *toolbar = new QToolBar;
|
||||||
vbox->addWidget( toolbar );
|
vbox->addWidget( toolbar );
|
||||||
|
const int iconSize = toolbar->style()->pixelMetric( QStyle::PixelMetric::PM_SmallIconSize );
|
||||||
|
toolbar->setIconSize( QSize( iconSize, iconSize ) );
|
||||||
|
|
||||||
QMenu* menu_view = TextureBrowser_constructViewMenu();
|
QMenu* menu_view = TextureBrowser_constructViewMenu();
|
||||||
|
|
||||||
@@ -1784,7 +1786,7 @@ QWidget* TextureBrowser_constructWindow( QWidget* toplevel ){
|
|||||||
//view menu button
|
//view menu button
|
||||||
toolbar_append_button( toolbar, "View", "texbro_view.png", PointerCaller<QMenu, void(), +[]( QMenu *menu ){ menu->popup( QCursor::pos() ); }>( menu_view ) );
|
toolbar_append_button( toolbar, "View", "texbro_view.png", PointerCaller<QMenu, void(), +[]( QMenu *menu ){ menu->popup( QCursor::pos() ); }>( menu_view ) );
|
||||||
|
|
||||||
toolbar_append_button( toolbar, "Find / Replace...", "texbro_gtk-find-and-replace.png", "FindReplaceTextures" );
|
toolbar_append_button( toolbar, "Find / Replace...", "texbro_find-replace.png", "FindReplaceTextures" );
|
||||||
|
|
||||||
toolbar_append_button( toolbar, "Flush & Reload Shaders", "texbro_refresh.png", "RefreshShaders" );
|
toolbar_append_button( toolbar, "Flush & Reload Shaders", "texbro_refresh.png", "RefreshShaders" );
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 776 B After Width: | Height: | Size: 776 B |
|
Before Width: | Height: | Size: 780 B After Width: | Height: | Size: 780 B |
|
Before Width: | Height: | Size: 581 B After Width: | Height: | Size: 581 B |
|
Before Width: | Height: | Size: 592 B After Width: | Height: | Size: 592 B |
|
Before Width: | Height: | Size: 384 B After Width: | Height: | Size: 384 B |
|
Before Width: | Height: | Size: 556 B After Width: | Height: | Size: 556 B |
|
Before Width: | Height: | Size: 444 B After Width: | Height: | Size: 444 B |
|
Before Width: | Height: | Size: 401 B After Width: | Height: | Size: 401 B |
|
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 198 B After Width: | Height: | Size: 198 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 316 B After Width: | Height: | Size: 316 B |
|
Before Width: | Height: | Size: 328 B After Width: | Height: | Size: 328 B |
|
Before Width: | Height: | Size: 514 B After Width: | Height: | Size: 514 B |
|
Before Width: | Height: | Size: 539 B After Width: | Height: | Size: 539 B |
|
Before Width: | Height: | Size: 360 B After Width: | Height: | Size: 360 B |
|
Before Width: | Height: | Size: 324 B After Width: | Height: | Size: 324 B |
|
Before Width: | Height: | Size: 294 B After Width: | Height: | Size: 294 B |
|
Before Width: | Height: | Size: 452 B After Width: | Height: | Size: 452 B |
|
Before Width: | Height: | Size: 153 B After Width: | Height: | Size: 153 B |
|
Before Width: | Height: | Size: 197 B After Width: | Height: | Size: 197 B |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 253 B After Width: | Height: | Size: 253 B |
|
Before Width: | Height: | Size: 254 B After Width: | Height: | Size: 254 B |
|
Before Width: | Height: | Size: 243 B After Width: | Height: | Size: 243 B |
|
Before Width: | Height: | Size: 263 B After Width: | Height: | Size: 263 B |
|
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 276 B |
|
Before Width: | Height: | Size: 334 B After Width: | Height: | Size: 334 B |
|
Before Width: | Height: | Size: 247 B After Width: | Height: | Size: 247 B |
|
Before Width: | Height: | Size: 852 B After Width: | Height: | Size: 852 B |
|
Before Width: | Height: | Size: 230 B After Width: | Height: | Size: 230 B |
|
Before Width: | Height: | Size: 393 B After Width: | Height: | Size: 393 B |
|
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 349 B |
|
Before Width: | Height: | Size: 506 B After Width: | Height: | Size: 506 B |
|
Before Width: | Height: | Size: 586 B After Width: | Height: | Size: 586 B |
|
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 270 B |
|
Before Width: | Height: | Size: 193 B After Width: | Height: | Size: 193 B |
|
Before Width: | Height: | Size: 254 B After Width: | Height: | Size: 254 B |
|
Before Width: | Height: | Size: 350 B After Width: | Height: | Size: 350 B |
|
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 228 B |
|
Before Width: | Height: | Size: 222 B After Width: | Height: | Size: 222 B |
|
Before Width: | Height: | Size: 864 B After Width: | Height: | Size: 864 B |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 205 B After Width: | Height: | Size: 205 B |
|
Before Width: | Height: | Size: 202 B After Width: | Height: | Size: 202 B |
|
Before Width: | Height: | Size: 210 B After Width: | Height: | Size: 210 B |
|
Before Width: | Height: | Size: 262 B After Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 486 B After Width: | Height: | Size: 486 B |
|
Before Width: | Height: | Size: 725 B After Width: | Height: | Size: 725 B |
|
Before Width: | Height: | Size: 313 B After Width: | Height: | Size: 313 B |
|
Before Width: | Height: | Size: 244 B After Width: | Height: | Size: 244 B |
|
Before Width: | Height: | Size: 332 B After Width: | Height: | Size: 332 B |
|
Before Width: | Height: | Size: 267 B After Width: | Height: | Size: 267 B |
|
Before Width: | Height: | Size: 414 B After Width: | Height: | Size: 414 B |
|
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 308 B |
|
Before Width: | Height: | Size: 365 B After Width: | Height: | Size: 365 B |
|
Before Width: | Height: | Size: 215 B After Width: | Height: | Size: 215 B |
|
Before Width: | Height: | Size: 224 B After Width: | Height: | Size: 224 B |
|
Before Width: | Height: | Size: 277 B After Width: | Height: | Size: 277 B |
|
Before Width: | Height: | Size: 237 B After Width: | Height: | Size: 237 B |
|
Before Width: | Height: | Size: 208 B After Width: | Height: | Size: 208 B |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 237 B After Width: | Height: | Size: 237 B |
|
Before Width: | Height: | Size: 422 B After Width: | Height: | Size: 422 B |
|
Before Width: | Height: | Size: 875 B After Width: | Height: | Size: 875 B |
|
Before Width: | Height: | Size: 783 B After Width: | Height: | Size: 783 B |
|
Before Width: | Height: | Size: 781 B After Width: | Height: | Size: 781 B |
|
Before Width: | Height: | Size: 188 B After Width: | Height: | Size: 188 B |
|
Before Width: | Height: | Size: 236 B After Width: | Height: | Size: 236 B |
|
Before Width: | Height: | Size: 710 B After Width: | Height: | Size: 710 B |
|
Before Width: | Height: | Size: 485 B After Width: | Height: | Size: 485 B |
|
Before Width: | Height: | Size: 222 B After Width: | Height: | Size: 222 B |
|
Before Width: | Height: | Size: 438 B After Width: | Height: | Size: 438 B |
|
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 226 B |
|
Before Width: | Height: | Size: 875 B After Width: | Height: | Size: 875 B |
|
Before Width: | Height: | Size: 883 B After Width: | Height: | Size: 883 B |
|
Before Width: | Height: | Size: 738 B After Width: | Height: | Size: 738 B |
|
Before Width: | Height: | Size: 873 B After Width: | Height: | Size: 873 B |