Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logo update #1401

Merged
merged 17 commits into from
Sep 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
ef9c092
Added png export series of new logo based on svg material in promo br…
DominiqueFuchs Sep 2, 2019
2e243e5
deleted old icon files (not sidebar logo files atm)
DominiqueFuchs Sep 3, 2019
0380271
Updated cmake module to current version (esp. worthy for newer window…
DominiqueFuchs Sep 3, 2019
b79a82c
Updated AddAppIconMacro (esp. for new macOS retina guidelines) and co…
DominiqueFuchs Sep 3, 2019
9d22545
Updated svg version of nc icon
DominiqueFuchs Sep 3, 2019
8bd85fa
Corrected sized icon versions to up2date windows guidelines (see also…
DominiqueFuchs Sep 3, 2019
af831a7
updated resources for new logo icon files
DominiqueFuchs Sep 3, 2019
7e4323c
Revert-corrected naming of icon files due to limitations by ECMAddApp…
DominiqueFuchs Sep 3, 2019
88dcbad
Updated theme.qrc to include new icon logo files
DominiqueFuchs Sep 3, 2019
7ac6df2
Updated ECMAddAppIcon to newest ver fromhttps://github.com/KDE/extra-…
DominiqueFuchs Sep 4, 2019
defa0b2
Merge branch 'master' into logo-update
DominiqueFuchs Sep 5, 2019
6f5dcfa
Complementary renaming in theme.qrc
DominiqueFuchs Sep 5, 2019
7aefa5a
Updated CmakeLists for gui part to correct old variable (OUTFILE_BASE…
DominiqueFuchs Sep 5, 2019
4b9e827
Merge branch 'logo-update' of https://github.com/DominiqueFuchs/deskt…
DominiqueFuchs Sep 5, 2019
e2f7947
Check for possible case failure when building on drone
DominiqueFuchs Sep 5, 2019
abb2711
Merge branch 'master' into logo-update
DominiqueFuchs Sep 5, 2019
ec603b0
Merge branch 'master' into logo-update
Sep 6, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions cmake/modules/AddAppIconMacro.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ macro (KDE4_ADD_APP_ICON appsources pattern)
endif (fn MATCHES ".*128.*")
if (fn MATCHES ".*256.*" )
list (APPEND _icons ${it})
endif (fn MATCHES ".*256.*")
endif (fn MATCHES ".*256.*")
if (fn MATCHES ".*512.*" )
list (APPEND _icons ${it})
endif (fn MATCHES ".*512.*")
if (fn MATCHES ".*1024.*" )
list (APPEND _icons ${it})
endif (fn MATCHES ".*1024.*")
endforeach (it)
if (_icons)
add_custom_command(OUTPUT ${_outfilename}.ico ${_outfilename}.rc
Expand Down Expand Up @@ -104,14 +110,14 @@ macro (KDE4_ADD_APP_ICON appsources pattern)
foreach (it ${files})
if (it MATCHES ".*sidebar-16.*")
configure_file(${it} ${appsources}.iconset/sidebar_16x16.png COPYONLY)
elseif (it MATCHES ".*sidebar-18.*")
configure_file(${it} ${appsources}.iconset/sidebar_18x18.png COPYONLY)
elseif (it MATCHES ".*sidebar-32.*")
configure_file(${it} ${appsources}.iconset/sidebar_18x18.png COPYONLY)
configure_file(${it} ${appsources}.iconset/sidebar_16x16@2x.png COPYONLY)
configure_file(${it} ${appsources}.iconset/sidebar_32x32.png COPYONLY)
elseif (it MATCHES ".*sidebar-36.*")
configure_file(${it} ${appsources}.iconset/sidebar_18x18@2x.png COPYONLY)
elseif (it MATCHES ".*sidebar-64.*")
configure_file(${it} ${appsources}.iconset/sidebar_18x18@2x.png COPYONLY)
elseif (it MATCHES ".*sidebar-128.*")
configure_file(${it} ${appsources}.iconset/sidebar_32x32.png COPYONLY)
elseif (it MATCHES ".*sidebar-256.*")
configure_file(${it} ${appsources}.iconset/sidebar_32x32@2x.png COPYONLY)
endif()
endforeach (it)
Expand Down
180 changes: 125 additions & 55 deletions cmake/modules/ECMAddAppIcon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#
# ecm_add_app_icon(<sources_var>
# ICONS <icon> [<icon> [...]]
# [SIDEBAR_ICONS <icon> [<icon> [...]] # Since 5.4x
# [OUTFILE_BASE <name>]) # Since 5.4x
# [SIDEBAR_ICONS <icon> [<icon> [...]] # Since 5.49
# [OUTFILE_BASENAME <name>]) # Since 5.49
# )
#
# The given icons, whose names must match the pattern::
Expand All @@ -27,20 +27,21 @@
#
# ``SIDEBAR_ICONS`` can be used to add Mac OS X sidebar
# icons to the generated iconset. They are used when a folder monitored by the
# application is dragged into Finder's sidebar. Since 5.4x.
# application is dragged into Finder's sidebar. Since 5.49.
#
# ``OUTFILE_BASE`` will be used as the basename for the icon file. If
# you specify it, the icon file will be called ``<OUTFILE_BASE>.icns`` on Mac OS X
# and ``<OUTFILE_BASE>.ico`` on Windows. If you don't specify it, it defaults
# to ``<sources_var>.<ext>``. Since 5.4x.
# ``OUTFILE_BASENAME`` will be used as the basename for the icon file. If
# you specify it, the icon file will be called ``<OUTFILE_BASENAME>.icns`` on Mac OS X
# and ``<OUTFILE_BASENAME>.ico`` on Windows. If you don't specify it, it defaults
# to ``<sources_var>.<ext>``. Since 5.49.
#
#
# Windows notes
# * Icons are compiled into the executable using a resource file.
# * Icons may not show up in Windows Explorer if the executable
# target does not have the ``WIN32_EXECUTABLE`` property set.
# * The tool png2ico is required. See :find-module:`FindPng2Ico`.
# * Supported sizes: 16, 32, 48, 64, 128.
# * One of the tools png2ico (See :find-module:`FindPng2Ico`) or
# icotool (see :find-module:`FindIcoTool`) is required.
# * Supported sizes: 16, 24, 32, 48, 64, 128, 256, 512 and 1024.
#
# Mac OS X notes
# * The executable target must have the ``MACOSX_BUNDLE`` property set.
Expand Down Expand Up @@ -101,7 +102,7 @@ include(CMakeParseArguments)

function(ecm_add_app_icon appsources)
set(options)
set(oneValueArgs OUTFILE_BASE)
set(oneValueArgs OUTFILE_BASENAME)
set(multiValueArgs ICONS SIDEBAR_ICONS)
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

Expand Down Expand Up @@ -138,9 +139,9 @@ function(ecm_add_app_icon appsources)
endif()


_ecm_add_app_icon_categorize_icons("${ARG_ICONS}" "icons" "16;32;48;64;128;256;512;1024")
_ecm_add_app_icon_categorize_icons("${ARG_ICONS}" "icons" "16;24;32;48;64;128;256;512;1024")
if(ARG_SIDEBAR_ICONS)
_ecm_add_app_icon_categorize_icons("${ARG_SIDEBAR_ICONS}" "sidebar_icons" "16;18;32;36;64")
_ecm_add_app_icon_categorize_icons("${ARG_SIDEBAR_ICONS}" "sidebar_icons" "16;32;64;128;256")
endif()

set(mac_icons
Expand All @@ -151,31 +152,37 @@ function(ecm_add_app_icon appsources)
${icons_at_128px}
${icons_at_256px}
${icons_at_512px}
${icons_at_1024px}
${icons_at_1024px})

set(mac_sidebar_icons
# Sidebar Icons: https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/Finder.html#//apple_ref/doc/uid/TP40014214-CH15-SW15
${sidebar_icons_at_16px}
${sidebar_icons_at_18px}
${sidebar_icons_at_32px}
${sidebar_icons_at_36px}
${sidebar_icons_at_64px})
if (NOT icons_at_128px)
message(AUTHOR_WARNING "No 128px icon provided; this will not work on Mac OS X")
${sidebar_icons_at_64px}
${sidebar_icons_at_128px}
${sidebar_icons_at_256px})

if (NOT (mac_icons OR mac_sidebar_icons))
message(AUTHOR_WARNING "No icons suitable for use on macOS provided")
endif()


set(windows_icons ${icons_at_16px}
${icons_at_32px}
${icons_at_48px}
${icons_at_64px}
${icons_at_128px}
${icons_at_256px})
if (NOT windows_icons)
set(windows_icons ${icons_at_16px}
${icons_at_24px}
${icons_at_32px}
${icons_at_48px}
${icons_at_64px}
${icons_at_128px}
${icons_at_256px}
${icons_at_512px}
${icons_at_1024px})

if (NOT (windows_icons))
message(AUTHOR_WARNING "No icons suitable for use on Windows provided")
endif()

if (ARG_OUTFILE_BASE)
set (_outfilebasename "${ARG_OUTFILE_BASE}")
if (ARG_OUTFILE_BASENAME)
set (_outfilebasename "${ARG_OUTFILE_BASENAME}")
else()
set (_outfilebasename "${appsources}")
endif()
Expand All @@ -185,26 +192,15 @@ function(ecm_add_app_icon appsources)
set(saved_CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_FIND_MODULE_DIR})
find_package(Png2Ico)
find_package(IcoTool)
set(CMAKE_MODULE_PATH "${saved_CMAKE_MODULE_PATH}")

if (Png2Ico_FOUND)
if (Png2Ico_HAS_RCFILE_ARGUMENT)
add_custom_command(
OUTPUT "${_outfilename}.rc" "${_outfilename}.ico"
COMMAND Png2Ico::Png2Ico
ARGS
--rcfile "${_outfilename}.rc"
"${_outfilename}.ico"
${windows_icons}
DEPENDS ${windows_icons}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
)
else()
function(create_windows_icon_and_rc command args deps)
add_custom_command(
OUTPUT "${_outfilename}.ico"
COMMAND Png2Ico::Png2Ico
ARGS "${_outfilename}.ico" ${windows_icons}
DEPENDS ${windows_icons}
COMMAND ${command}
ARGS ${args}
DEPENDS ${deps}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
)
# this bit's a little hacky to make the dependency stuff work
Expand All @@ -216,12 +212,72 @@ function(ecm_add_app_icon appsources)
DEPENDS "${_outfilename}.ico"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
endif()
endfunction()

if (IcoTool_FOUND)
list(APPEND icotool_args "-c" "-o" "${_outfilename}.ico")

# According to https://stackoverflow.com/a/40851713/2886832
# Windows always chooses the first icon above 255px, all other ones will be ignored
set(maxSize 0)
foreach(size 256 512 1024)
if(icons_at_${size}px)
set(maxSize "${size}")
endif()
endforeach()

foreach(size 16 24 32 48 64 128 ${maxSize})
if(NOT icons_at_${size}px)
continue()
endif()

set(icotool_icon_arg "")
if(size STREQUAL "${maxSize}")
# maxSize icon needs to be included as raw png
list(APPEND icotool_args "-r")
endif()

foreach(icon ${icons_at_${size}px})
list(APPEND icotool_args "${icons_at_${size}px}")
endforeach()
endforeach()

create_windows_icon_and_rc(IcoTool::IcoTool "${icotool_args}" "${windows_icons_modern}")
set(${appsources} "${${appsources}};${_outfilename}.rc" PARENT_SCOPE)

# standard png2ico has no rcfile argument
# NOTE: We generally use https://github.com/hiiamok/png2ImageMagickICO
# or similar on windows, which is why we provide resolutions >= 256px here.
# Standard png2ico will fail with this.
elseif(Png2Ico_FOUND AND NOT Png2Ico_HAS_RCFILE_ARGUMENT AND windows_icons)
set(png2ico_args)
list(APPEND png2ico_args "${_outfilename}.ico")
list(APPEND png2ico_args "${windows_icons}")
create_windows_icon_and_rc(Png2Ico::Png2Ico "${png2ico_args}" "${windows_icons}")

set(${appsources} "${${appsources}};${_outfilename}.rc" PARENT_SCOPE)

# png2ico from kdewin provides rcfile argument
elseif(Png2Ico_FOUND AND windows_icons)
add_custom_command(
OUTPUT "${_outfilename}.rc" "${_outfilename}.ico"
COMMAND Png2Ico::Png2Ico
ARGS
--rcfile "${_outfilename}.rc"
"${_outfilename}.ico"
${windows_icons}
DEPENDS ${windows_icons}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
)

set(${appsources} "${${appsources}};${_outfilename}.rc" PARENT_SCOPE)

# else none of the supported tools was found
else()
message(WARNING "Unable to find the png2ico utility - application will not have an application icon!")
message(WARNING "Unable to find the png2ico or icotool utilities or icons in matching sizes - application will not have an application icon!")
endif()
elseif (APPLE AND mac_icons)

elseif (APPLE AND (mac_icons OR mac_sidebar_icons))
# first generate .iconset directory structure, then convert to .icns format using the Mac OS X "iconutil" utility,
# to create retina compatible icon, you need png source files in pixel resolution 16x16, 32x32, 64x64, 128x128,
# 256x256, 512x512, 1024x1024
Expand All @@ -246,8 +302,11 @@ function(ecm_add_app_icon appsources)
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
)
list(APPEND iconset_icons
"${_outfilename}.iconset/${type}_${sizename}.png")
"${_outfilename}.iconset/${type}_${sizename}.png")
endmacro()

# List of supported sizes and filenames taken from:
# https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Optimizing/Optimizing.html#//apple_ref/doc/uid/TP40012302-CH7-SW4
foreach(size 16 32 128 256 512)
math(EXPR double_size "2 * ${size}")
foreach(file ${icons_at_${size}px})
Expand All @@ -258,14 +317,25 @@ function(ecm_add_app_icon appsources)
endforeach()
endforeach()

foreach(size 16 18 32)
math(EXPR double_size "2 * ${size}")
foreach(file ${sidebar_icons_at_${size}px})
copy_icon("${file}" "${size}x${size}" "sidebar")
endforeach()
foreach(file ${sidebar_icons_at_${double_size}px})
copy_icon("${file}" "${size}x${size}@2x" "sidebar")
endforeach()
# List of supported sizes and filenames taken from:
# https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/Finder.html#//apple_ref/doc/uid/TP40014214-CH15-SW15
foreach(file ${sidebar_icons_at_16px})
copy_icon("${file}" "16x16" "sidebar")
endforeach()
foreach(file ${sidebar_icons_at_32px})
copy_icon("${file}" "16x16@2x" "sidebar")
endforeach()
foreach(file ${sidebar_icons_at_32px})
copy_icon("${file}" "18x18" "sidebar")
endforeach()
foreach(file ${sidebar_icons_at_64px})
copy_icon("${file}" "18x18@2x" "sidebar")
endforeach()
foreach(file ${sidebar_icons_at_128px})
copy_icon("${file}" "32x32" "sidebar")
endforeach()
foreach(file ${sidebar_icons_at_256px})
copy_icon("${file}" "32x32@2x" "sidebar")
endforeach()

# generate .icns icon file
Expand Down
2 changes: 1 addition & 1 deletion src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ if(APPLE)
file(GLOB_RECURSE OWNCLOUD_SIDEBAR_ICONS "${theme_dir}/colored/*-${APPLICATION_ICON_NAME}-sidebar*")
MESSAGE(STATUS "OWNCLOUD_SIDEBAR_ICONS: ${APPLICATION_ICON_NAME}: ${OWNCLOUD_SIDEBAR_ICONS}")
endif()
ecm_add_app_icon(final_src ICONS "${OWNCLOUD_ICONS}" SIDEBAR_ICONS "${OWNCLOUD_SIDEBAR_ICONS}" OUTFILE_BASE "${APPLICATION_ICON_NAME}")
ecm_add_app_icon(final_src ICONS "${OWNCLOUD_ICONS}" SIDEBAR_ICONS "${OWNCLOUD_SIDEBAR_ICONS}" OUTFILE_BASENAME "${APPLICATION_ICON_NAME}")

if(UNIX AND NOT APPLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
Expand Down
10 changes: 6 additions & 4 deletions theme.qrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<RCC>
<qresource prefix="/client">
<file alias="theme/colored/Nextcloud-icon-512.png">theme/colored/512-Nextcloud-icon.png</file>
<file alias="theme/colored/Nextcloud-icon-256.png">theme/colored/256-Nextcloud-icon.png</file>
<file alias="theme/colored/Nextcloud-icon-128.png">theme/colored/128-Nextcloud-icon.png</file>
<file alias="theme/colored/Nextcloud-icon-22.png">theme/colored/22-Nextcloud-icon.png</file>
<file alias="theme/colored/Nextcloud-icon-16.png">theme/colored/16-Nextcloud-icon.png</file>
<file alias="theme/colored/Nextcloud-icon-24.png">theme/colored/24-Nextcloud-icon.png</file>
<file alias="theme/colored/Nextcloud-icon-32.png">theme/colored/32-Nextcloud-icon.png</file>
<file alias="theme/colored/Nextcloud-icon-48.png">theme/colored/48-Nextcloud-icon.png</file>
<file alias="theme/colored/Nextcloud-icon-64.png">theme/colored/64-Nextcloud-icon.png</file>
<file alias="theme/colored/Nextcloud-icon-128.png">theme/colored/128-Nextcloud-icon.png</file>
<file alias="theme/colored/Nextcloud-icon-256.png">theme/colored/256-Nextcloud-icon.png</file>
<file alias="theme/colored/Nextcloud-icon-512.png">theme/colored/512-Nextcloud-icon.png</file>
<file alias="theme/colored/Nextcloud-icon-1024.png">theme/colored/1024-Nextcloud-icon.png</file>
<file>theme/colored/state-error-32.png</file>
<file>theme/colored/state-error-64.png</file>
<file>theme/colored/state-error-128.png</file>
Expand Down
Binary file modified theme/colored/1024-Nextcloud-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified theme/colored/128-Nextcloud-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added theme/colored/128-Nextcloud-sidebar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified theme/colored/16-Nextcloud-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified theme/colored/16-Nextcloud-sidebar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed theme/colored/18-Nextcloud-sidebar.png
Binary file not shown.
Binary file removed theme/colored/22-Nextcloud-icon.png
Binary file not shown.
Binary file added theme/colored/24-Nextcloud-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified theme/colored/256-Nextcloud-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added theme/colored/256-Nextcloud-sidebar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified theme/colored/32-Nextcloud-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified theme/colored/32-Nextcloud-sidebar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed theme/colored/36-Nextcloud-sidebar.png
Binary file not shown.
Binary file modified theme/colored/48-Nextcloud-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified theme/colored/512-Nextcloud-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified theme/colored/64-Nextcloud-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified theme/colored/64-Nextcloud-sidebar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 1 addition & 70 deletions theme/colored/Nextcloud-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.