Skip to content

Commit

Permalink
3161: highdpi icons support, render SVG's at runtime (TrenchBroom#3231)
Browse files Browse the repository at this point in the history
* 3161: cmake changes for depending on QtSvg

* 3161: remove some unused .png's

* 3161: delete .png's and move .svg's to images folder

* 3161: redraw IssueBrowser.png as .svg

* 3161: first draft working

* 3161: fix svg's not copying on macOS

* 3161: fix macOS high-dpi icon issues

* 3161: refer to .svg icons directly

* 3161: fix lock icon being too large

* 3161: remove stroke from lock icons

* 3161: fixes to texture lock / uv lock icons

- remove unwanted strokes
- change checkerboard pattern to filled rectangles

* 3161: clean up loading code and reuse SVG renderer

* 3161: disable stroke on padlock key hole

* 3161: fix not copying png icons on macOS

* 3161: loadIconResourceQt is now .svg only

* 3161: rename loadIconResourceQt to loadSVGIcon for clarity

* 3161: update debian dependencies
  • Loading branch information
ericwa authored May 23, 2020
1 parent 34cb90b commit f53868f
Show file tree
Hide file tree
Showing 116 changed files with 792 additions and 587 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test"
- sourceline: "ppa:beineri/opt-qt595-xenial"
packages:
- g++-7 qt59base freeglut3-dev libglew-dev mesa-common-dev build-essential libglm-dev libxxf86vm-dev libfreeimage-dev pandoc cmake p7zip-full ninja-build xvfb rpm cppcheck
- g++-7 qt59base qt59svg freeglut3-dev libglew-dev mesa-common-dev build-essential libglm-dev libxxf86vm-dev libfreeimage-dev pandoc cmake p7zip-full ninja-build xvfb rpm cppcheck
- os: linux
dist: xenial
env: TB_GCC8=true
Expand All @@ -19,7 +19,7 @@ matrix:
- sourceline: "ppa:ubuntu-toolchain-r/test"
- sourceline: "ppa:beineri/opt-qt595-xenial"
packages:
- g++-8 qt59base freeglut3-dev libglew-dev mesa-common-dev build-essential libglm-dev libxxf86vm-dev libfreeimage-dev pandoc cmake p7zip-full ninja-build xvfb rpm cppcheck
- g++-8 qt59base qt59svg freeglut3-dev libglew-dev mesa-common-dev build-essential libglm-dev libxxf86vm-dev libfreeimage-dev pandoc cmake p7zip-full ninja-build xvfb rpm cppcheck
- os: osx
osx_image: xcode11.3
- os: osx
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
# Find Qt and OpenGL
find_package(OpenGL REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Svg REQUIRED)

# Find threads lib, needed to work around a gtest bug, see: https://stackoverflow.com/questions/21116622/undefined-reference-to-pthread-key-create-linker-error
# The googletest target links to this
Expand Down
6 changes: 4 additions & 2 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if(APPLE)
set_source_files_properties(${MACOSX_ICON_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)

# Configure button bitmaps etc.
file(GLOB_RECURSE MACOSX_IMAGE_FILES "${APP_RESOURCE_DIR}/graphics/images/*.png")
file(GLOB_RECURSE MACOSX_IMAGE_FILES "${APP_RESOURCE_DIR}/graphics/images/*")
set(APP_SOURCE ${APP_SOURCE} ${MACOSX_IMAGE_FILES})
set_source_files_properties(${MACOSX_IMAGE_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources/images)

Expand Down Expand Up @@ -152,6 +152,7 @@ macro(configure_app_target APP_TARGET_NAME SHOULD_BUILD_MANUAL)
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:Qt5::Widgets>" "$<TARGET_FILE_DIR:${APP_TARGET_NAME}>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:Qt5::Gui>" "$<TARGET_FILE_DIR:${APP_TARGET_NAME}>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:Qt5::Core>" "$<TARGET_FILE_DIR:${APP_TARGET_NAME}>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:Qt5::Svg>" "$<TARGET_FILE_DIR:${APP_TARGET_NAME}>"
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:${APP_TARGET_NAME}>/platforms"
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:${APP_TARGET_NAME}>/styles"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:Qt5::QWindowsIntegrationPlugin>" "$<TARGET_FILE_DIR:${APP_TARGET_NAME}>/platforms"
Expand Down Expand Up @@ -275,6 +276,7 @@ if(WIN32)
$<TARGET_FILE:Qt5::Widgets>
$<TARGET_FILE:Qt5::Gui>
$<TARGET_FILE:Qt5::Core>
$<TARGET_FILE:Qt5::Svg>
DESTINATION . COMPONENT TrenchBroom)

#Qt plugins
Expand Down Expand Up @@ -350,7 +352,7 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# The following dependencies were generated by running with CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON, and then adding "libqt5widgets5 (>= 5.9.5)" as an alternate for qt59base.
# Our CI builds on Ubuntu 16.04 need to pull Qt 5.9.5 from ppa:beineri/opt-qt595-xenial, which is where the "qt59base" package comes from.
# We want to support Ubuntu 18.04, though, which should have libqt5widgets5 5.9.5.
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.14), libfreeimage3, libfreetype6 (>= 2.2.1), libgcc1 (>= 1:3.0), libgl1-mesa-glx | libgl1, libstdc++6 (>= 5.2), qt59base | libqt5widgets5 (>= 5.9.5)")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.14), libfreeimage3, libfreetype6 (>= 2.2.1), libgcc1 (>= 1:3.0), libgl1-mesa-glx | libgl1, libstdc++6 (>= 5.2), qt59base | libqt5widgets5 (>= 5.9.5), qt59svg | libqt5svg5 (>= 5.9.5)")
set(CPACK_DEBIAN_PACKAGE_SECTION "games")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://kristianduske.com/trenchbroom/")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/linux/postinst;${CMAKE_CURRENT_BINARY_DIR}/linux/prerm;${CMAKE_CURRENT_BINARY_DIR}/linux/postrm")
Expand Down
Binary file removed app/resources/graphics/images/Add.png
Binary file not shown.
File renamed without changes
Binary file removed app/resources/graphics/images/BrushTool.png
Binary file not shown.
Binary file removed app/resources/graphics/images/ClipTool.png
Binary file not shown.
File renamed without changes
Binary file removed app/resources/graphics/images/Console.png
Binary file not shown.
Binary file removed app/resources/graphics/images/ConsolePressed.png
Binary file not shown.
Binary file removed app/resources/graphics/images/DefaultGameIcon.png
Binary file not shown.
Binary file removed app/resources/graphics/images/Down.png
Binary file not shown.
File renamed without changes
Binary file removed app/resources/graphics/images/DuplicateObjects.png
Binary file not shown.
Binary file removed app/resources/graphics/images/EdgeTool.png
Binary file not shown.
File renamed without changes
Binary file removed app/resources/graphics/images/EditMods.png
Binary file not shown.
Binary file removed app/resources/graphics/images/FaceTool.png
Binary file not shown.
File renamed without changes
Binary file removed app/resources/graphics/images/FlipHorizontally.png
Binary file not shown.
Binary file removed app/resources/graphics/images/FlipTextureH.png
Binary file not shown.
Binary file removed app/resources/graphics/images/FlipTextureV.png
Binary file not shown.
Binary file removed app/resources/graphics/images/FlipVertically.png
Diff not rendered.
Binary file removed app/resources/graphics/images/GeneralPreferences.png
Diff not rendered.
Binary file removed app/resources/graphics/images/Grid.png
Diff not rendered.
Binary file removed app/resources/graphics/images/Hidden_off.png
Diff not rendered.
Binary file removed app/resources/graphics/images/Hidden_on.png
Diff not rendered.
Binary file removed app/resources/graphics/images/Invisible_White.png
Diff not rendered.
Binary file removed app/resources/graphics/images/IssueBrowser.png
Diff not rendered.
82 changes: 82 additions & 0 deletions app/resources/graphics/images/IssueBrowser.svg
Diff not rendered.
Binary file removed app/resources/graphics/images/KeyboardPreferences.png
Diff not rendered.
Binary file removed app/resources/graphics/images/Lock_off.png
Diff not rendered.
Binary file removed app/resources/graphics/images/Lock_on.png
Diff not rendered.
Binary file removed app/resources/graphics/images/Locked_small.png
Diff not rendered.
Loading

0 comments on commit f53868f

Please sign in to comment.