Skip to content

Commit

Permalink
Merge branch 'svg_icons' into 'master'
Browse files Browse the repository at this point in the history
Rework editor icons

See merge request OpenMW/openmw!4024
  • Loading branch information
psi29a committed Apr 16, 2024
2 parents b574155 + 1ad9e5f commit e1be24e
Show file tree
Hide file tree
Showing 341 changed files with 19,217 additions and 373 deletions.
22 changes: 20 additions & 2 deletions CI/before_script.msvc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,16 @@ add_qt_style_dlls() {
QT_STYLES[$CONFIG]="${QT_STYLES[$CONFIG]} $@"
}

declare -A QT_IMAGEFORMATS
QT_IMAGEFORMATS["Release"]=""
QT_IMAGEFORMATS["Debug"]=""
QT_IMAGEFORMATS["RelWithDebInfo"]=""
add_qt_image_dlls() {
local CONFIG=$1
shift
QT_IMAGEFORMATS[$CONFIG]="${QT_IMAGEFORMATS[$CONFIG]} $@"
}

if [ -z $PLATFORM ]; then
PLATFORM="$(uname -m)"
fi
Expand Down Expand Up @@ -913,12 +923,13 @@ printf "Qt ${QT_VER}... "
DLLSUFFIX=""
fi
if [ "${QT_VER:0:1}" -eq "6" ]; then
add_runtime_dlls $CONFIGURATION "$(pwd)/bin/Qt${QT_VER:0:1}"{Core,Gui,Network,OpenGL,OpenGLWidgets,Widgets}${DLLSUFFIX}.dll
add_runtime_dlls $CONFIGURATION "$(pwd)/bin/Qt${QT_VER:0:1}"{Core,Gui,Network,OpenGL,OpenGLWidgets,Widgets,Svg}${DLLSUFFIX}.dll
else
add_runtime_dlls $CONFIGURATION "$(pwd)/bin/Qt${QT_VER:0:1}"{Core,Gui,Network,OpenGL,Widgets}${DLLSUFFIX}.dll
add_runtime_dlls $CONFIGURATION "$(pwd)/bin/Qt${QT_VER:0:1}"{Core,Gui,Network,OpenGL,Widgets,Svg}${DLLSUFFIX}.dll
fi
add_qt_platform_dlls $CONFIGURATION "$(pwd)/plugins/platforms/qwindows${DLLSUFFIX}.dll"
add_qt_style_dlls $CONFIGURATION "$(pwd)/plugins/styles/qwindowsvistastyle${DLLSUFFIX}.dll"
add_qt_image_dlls $CONFIGURATION "$(pwd)/plugins/imageformats/qsvg${DLLSUFFIX}.dll"
done
echo Done.
}
Expand Down Expand Up @@ -1112,6 +1123,13 @@ fi
echo " $(basename $DLL)"
cp "$DLL" "${DLL_PREFIX}styles"
done

echo "- Qt Image Format DLLs..."
mkdir -p ${DLL_PREFIX}imageformats
for DLL in ${QT_IMAGEFORMATS[$CONFIGURATION]}; do
echo " $(basename $DLL)"
cp "$DLL" "${DLL_PREFIX}imageformats"
done
echo
done
#fi
Expand Down
2 changes: 1 addition & 1 deletion CI/install_debian_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ declare -rA GROUPED_DEPS=(
libsdl2-dev libqt5opengl5-dev qttools5-dev qttools5-dev-tools libopenal-dev
libunshield-dev libtinyxml-dev libbullet-dev liblz4-dev libpng-dev libjpeg-dev
libluajit-5.1-dev librecast-dev libsqlite3-dev ca-certificates libicu-dev
libyaml-cpp-dev
libyaml-cpp-dev libqt5svg5 libqt5svg5-dev
"

# These dependencies can alternatively be built and linked statically.
Expand Down
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ find_package(LZ4 REQUIRED)
if (USE_QT)
find_package(QT REQUIRED COMPONENTS Core NAMES Qt6 Qt5)
if (QT_VERSION_MAJOR VERSION_EQUAL 5)
find_package(Qt5 5.15 COMPONENTS Core Widgets Network OpenGL LinguistTools REQUIRED)
find_package(Qt5 5.15 COMPONENTS Core Widgets Network OpenGL LinguistTools Svg REQUIRED)
else()
find_package(Qt6 COMPONENTS Core Widgets Network OpenGL OpenGLWidgets LinguistTools REQUIRED)
find_package(Qt6 COMPONENTS Core Widgets Network OpenGL OpenGLWidgets LinguistTools Svg REQUIRED)
endif()
message(STATUS "Using Qt${QT_VERSION}")
endif()
Expand Down Expand Up @@ -834,6 +834,12 @@ if (OPENMW_OSX_DEPLOYMENT AND APPLE)
configure_file("${QT_COCOA_PLUGIN_PATH}" "${OPENCS_BUNDLE_NAME}/Contents/PlugIns/${QT_COCOA_PLUGIN_GROUP}/${QT_COCOA_PLUGIN_NAME}" COPYONLY)
configure_file("${QT_QMACSTYLE_PLUGIN_PATH}" "${OPENCS_BUNDLE_NAME}/Contents/PlugIns/${QT_QMACSTYLE_PLUGIN_GROUP}/${QT_QMACSTYLE_PLUGIN_NAME}" COPYONLY)
configure_file("${OpenMW_SOURCE_DIR}/files/mac/qt.conf" "${OPENCS_BUNDLE_NAME}/Contents/Resources/qt.conf" COPYONLY)

get_property(QT_QSVG_PLUGIN_PATH TARGET Qt${QT_VERSION_MAJOR}::QSvgPlugin PROPERTY LOCATION_RELEASE)
get_filename_component(QT_QSVG_PLUGIN_DIR "${QT_QSVG_PLUGIN_PATH}" DIRECTORY)
get_filename_component(QT_QSVG_PLUGIN_GROUP "${QT_QSVG_PLUGIN_DIR}" NAME)
get_filename_component(QT_QSVG_PLUGIN_NAME "${QT_QSVG_PLUGIN_PATH}" NAME)
configure_file("${QT_QSVG_PLUGIN_PATH}" "${OPENCS_BUNDLE_NAME}/Contents/PlugIns/${QT_QSVG_PLUGIN_GROUP}/${QT_QSVG_PLUGIN_NAME}" COPYONLY)
endif ()

install(DIRECTORY "${APP_BUNDLE_DIR}" USE_SOURCE_PERMISSIONS DESTINATION "." COMPONENT Runtime)
Expand Down
4 changes: 2 additions & 2 deletions apps/opencs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ target_link_libraries(openmw-cs-lib
)

if (QT_VERSION_MAJOR VERSION_EQUAL 6)
target_link_libraries(openmw-cs-lib Qt::Widgets Qt::Core Qt::Network Qt::OpenGL Qt::OpenGLWidgets)
target_link_libraries(openmw-cs-lib Qt::Widgets Qt::Core Qt::Network Qt::OpenGL Qt::OpenGLWidgets Qt::Svg)
else()
target_link_libraries(openmw-cs-lib Qt::Widgets Qt::Core Qt::Network Qt::OpenGL)
target_link_libraries(openmw-cs-lib Qt::Widgets Qt::Core Qt::Network Qt::OpenGL Qt::Svg)
endif()

if (WIN32)
Expand Down
2 changes: 1 addition & 1 deletion apps/opencs/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int runApplication(int argc, char* argv[])

Application application(argc, argv);

application.setWindowIcon(QIcon(":./openmw-cs.png"));
application.setWindowIcon(QIcon(":openmw-cs"));

CS::Editor editor(argc, argv);
#ifdef __linux__
Expand Down
2 changes: 1 addition & 1 deletion apps/opencs/model/world/tablemimedata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ std::string CSMWorld::TableMimeData::getIcon() const

if (tmpIcon != id.getIcon())
{
return ":/multitype.png"; // icon stolen from gnome TODO: get new icon
return ":multitype";
}

tmpIcon = id.getIcon();
Expand Down
Loading

0 comments on commit e1be24e

Please sign in to comment.