feat: add an icon...

This commit is contained in:
Gary Wang 2020-04-08 18:16:45 +08:00
parent 9f940e5046
commit 2e543bfe0a
5 changed files with 243 additions and 2 deletions

View File

@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.5)
project(pineapple-music LANGUAGES CXX) project(pineapple-music LANGUAGES CXX)
include (GNUInstallDirs)
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOUIC ON)
@ -13,7 +15,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt5 COMPONENTS Widgets Multimedia REQUIRED) find_package(Qt5 COMPONENTS Widgets Multimedia REQUIRED)
add_executable(pineapple-music set (EXE_NAME pmusic)
add_executable(${EXE_NAME}
main.cpp main.cpp
mainwindow.cpp mainwindow.cpp
mainwindow.h mainwindow.h
@ -25,4 +29,52 @@ add_executable(pineapple-music
resources.qrc resources.qrc
) )
target_link_libraries(pineapple-music PRIVATE Qt5::Widgets Qt5::Multimedia) target_link_libraries(${EXE_NAME} PRIVATE Qt5::Widgets Qt5::Multimedia)
# Helper macros for install settings
macro (pmusic_convert_to_relative_path _var)
# Make sure _var is a relative path
if (IS_ABSOLUTE "${${_var}}")
file (RELATIVE_PATH ${_var} "${CMAKE_INSTALL_PREFIX}" "${${_var}}")
endif ()
endmacro ()
# Install settings
if (WIN32)
# FIXME: try to avoid install to a "bin" subfolder under windows...
# when fixed, don't forget to update the CI config file...
set (BIN_INSTALL_DIR "") # seems useless, don't know why...
elseif (UNIX)
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX /usr)
endif ()
set (BIN_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}") # relative, usually "bin"
pmusic_convert_to_relative_path(BIN_INSTALL_DIR)
set (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}") # "lib" or "lib64"
pmusic_convert_to_relative_path(LIB_INSTALL_DIR)
# install icon
install (
FILES icons/app-icon.svg
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps"
RENAME pineapple-music.svg
)
# install shortcut
install (
FILES pineapple-music.desktop
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications"
)
endif()
set (INSTALL_TARGETS_DEFAULT_ARGS
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR} COMPONENT Devel
)
install (
TARGETS ${EXE_NAME}
${INSTALL_TARGETS_DEFAULT_ARGS}
)

172
icons/app-icon.svg Executable file
View File

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="24"
height="24"
viewBox="0 0 6.3499999 6.3500002"
version="1.1"
id="svg8"
sodipodi:docname="pmusic-2.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<defs
id="defs2">
<linearGradient
inkscape:collect="always"
id="linearGradient6074">
<stop
style="stop-color:#ffffff;stop-opacity:1"
offset="0"
id="stop6070" />
<stop
style="stop-color:#b6b6b6;stop-opacity:1"
offset="1"
id="stop6072" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient6062">
<stop
style="stop-color:#064c74;stop-opacity:1;"
offset="0"
id="stop6058" />
<stop
style="stop-color:#63b2de;stop-opacity:0.95212764"
offset="1"
id="stop6060" />
</linearGradient>
<linearGradient
id="linearGradient6054"
osb:paint="solid">
<stop
style="stop-color:#064c74;stop-opacity:1;"
offset="0"
id="stop6052" />
</linearGradient>
<image
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAITUlEQVRYhZ2YbWxeZRnHf/d9n+d5+vRlXdutW7euYy/M7IUxWgERh0wBiUaixCgmBo2wL0bCBxM0xgQSvxgMid/4oomSkRggagyQsFE6JGRMxlKYK6PDwlbatd26vrfPy7mvyw/3OadPG0YiJ7lzznOfl+t//a/3x/DZh0lWBOSBIlCMmlobG667YXPU3L7J1jW0VBdnp6pT46Oli2dH/ML0PLCUrAoQA5qsawr5LOEuEbymrfuuvU27er6VW7v+kCs27hFRK14QEcQLXgTxVYnnpgfK0xN9pQtnXioNnjwLzCaA/LXAfBoIA1igADSv6/76De233PuLfOuGu0XUpEJFBBGfAPDJtcfHyX4ca3l6/NjS+28+VRk6fQaYAcqArAayGkSmvY1yG3b/+PHHipt3/ARMLghdKVzE45OziOC9R3wc9mNB4hjv42pl4uKf519/5knEj69iBRKBqwE0NHZev33fQ799ur7juvutcQ5jwJiVj5qVOqhq9llVAEUxKDhbbOpxm/cd8FcunNTywgLLfrICRGqC+qbOXdv3//SJvxZa1vcYY8Md1WVxmrxrlhmt5VZXnBXUBDi5wlbXcf2dfuKjXi0vzCVAVoCwQJ2Nch09P/v904WW9h5jzLLC6QdF0QQUqiiJ9iYVqQkjmjGjRgJuVdRF62xb15744/5XUc3M4hIWckDLLY/+4TdNW3bcb4zBYDDhe3Q0F1H1lCtVVDyooKLJ/QSIKpoqn5oHRdVk1ygQFbaa1q6CHz7zFomjutQMW77y7Z6ug/c9aa1zJrG/GgPquW3bOp564HbyzjA4coWlcgnEo+JRVVQlsCAZH8uAVFAkY0gQTKG4X5bmX9XZiXGg6hIWWnsefuJ3dc1tu4y1NTYQVISu5jwH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jJMR36g8Aw1dmePHUB/QPjSHGYgv1Cf0ONWGJsUl2VELCTGPTpKVeZeLDl1IQlaHXnh/oOvidYw0bt9yjgCY9o6Q+oUKlUmF8vsKxgVHeuzCO9zGmrh5nHdhEsHUYY8myr0hoa02MGlmuISg6P3nUX+gfACoutVBcrQy37b75ARVxoqA+dM8iMZHGnJtY4OX3JxifK6HGYFwOE+UxUQET5SGXx7hc4oTBDKGhEbySMJr4WhxXqufeeERnJ4aAUtre6ezw4Fzrru6WXHNbj9bMEhp7pkoxlxeroSJigt1dhI0KEOXA5cKeccHzsZlPiSYRFAd21Qvx1dE/Vgd6nwfmAJ+BAPzYO73vte+/44Ctq98qGpigNmxVUWvBOIgi1DnUhtDDmKyVU6941WUgsQ/MiuDnJ18vvXnkl6heIUxoWtvyi4pUpobOnGzdfeudJsqtU1G8+CQiQFJBxoKxhD45+ICqIp7Mh8SHAihxzZxSnjtXOvm3w1qa/wQopXm5FgSAr85PL0yf7+9ds23fHpOv26o+OGhwWM3CPAgDSSqiTzOm90gcJ/QHNlU88fzVfy2dfOFhmZ34CFikZhJbDUKBuDo/PTd+6lhvU9fuom1o3q8qTtN5UwVVv9w5pZR7CdNYnIyDyZ5KtRJPDv9p4fhfHksYWGDVKLgaRAYElaUr7x4/UZm9+mp+7YZ2WyjuEBGT0ZzOpGk/ke4n91S8Vmcmji6dee2RpXePPpf4QGk1APg/pvKWA4f2Nu246ZvRmvWHXH3j3tqpXCXVPJZ4fuZsZeZyX3n47Mul8//+3FP5p4FZ+f9EY0tjfdeeTVHzhg5TqG+Ll+Ym46nxS6WRc6Of5/+J/wGMxWYqKOu9cAAAAABJRU5ErkJggg=="
height="33px"
width="33px"
id="_Image2" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6062"
id="linearGradient6066"
x1="9.8813362"
y1="296.04913"
x2="4.9306054"
y2="291.95044"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.96309038,0,0,0.96309038,-3.8640328,10.606208)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient6074"
id="linearGradient6076"
x1="1.9155039"
y1="292.05603"
x2="4.8338767"
y2="293.74635"
gradientUnits="userSpaceOnUse" />
<filter
style="color-interpolation-filters:sRGB;"
inkscape:label="Drop Shadow"
id="filter7264">
<feFlood
flood-opacity="1"
flood-color="rgb(0,0,0)"
result="flood"
id="feFlood7254" />
<feComposite
in="flood"
in2="SourceGraphic"
operator="in"
result="composite1"
id="feComposite7256" />
<feGaussianBlur
in="composite1"
stdDeviation="5.2"
result="blur"
id="feGaussianBlur7258" />
<feOffset
dx="0.3"
dy="0.8"
result="offset"
id="feOffset7260" />
<feComposite
in="SourceGraphic"
in2="offset"
operator="over"
result="composite2"
id="feComposite7262" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="22.4"
inkscape:cx="20.609898"
inkscape:cy="13.433958"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-290.64998)">
<ellipse
style="fill:url(#linearGradient6066);fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4542"
cx="3.1832683"
cy="293.82852"
rx="3.0820651"
ry="3.0593133" />
<path
sodipodi:type="star"
style="fill:url(#linearGradient6076);fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter7264)"
id="path6068"
sodipodi:sides="3"
sodipodi:cx="2.8820686"
sodipodi:cy="293.75174"
sodipodi:r1="1.9518368"
sodipodi:r2="1.2993468"
sodipodi:arg1="0.0055247794"
sodipodi:arg2="1.0527224"
inkscape:flatsided="true"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 4.8338757,293.76252 -2.9370493,1.67414 0.018677,-3.38063 z"
transform="matrix(0.89945902,0,0,0.76939921,0.34426161,67.832633)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

@ -19,6 +19,10 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Pineapple Player</string> <string>Pineapple Player</string>
</property> </property>
<property name="windowIcon">
<iconset resource="resources.qrc">
<normaloff>:/icons/icons/app-icon.svg</normaloff>:/icons/icons/app-icon.svg</iconset>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">/****** Slider ******/ <string notr="true">/****** Slider ******/

12
pineapple-music.desktop Normal file
View File

@ -0,0 +1,12 @@
[Desktop Entry]
Categories=Player;Audio;
Comment=Pineapple Music Audio Player.
Exec=pmusic %F
GenericName=Music
Icon=pineapple-music
Keywords=Picture;Image;Viewer;Jpg;Jpeg;Png;
MimeType=application/ogg;application/x-ogg;audio/ogg;audio/vorbis;audio/x-vorbis;audio/x-vorbis+ogg;video/ogg;video/x-ogm;video/x-ogm+ogg;video/x-theora+ogg;video/x-theora;audio/x-speex;audio/opus;application/x-flac;audio/flac;audio/x-flac;audio/x-ms-asf;audio/x-ms-asx;audio/x-ms-wax;audio/x-ms-wma;video/x-ms-asf;video/x-ms-asf-plugin;video/x-ms-asx;video/x-ms-wm;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvx;video/x-msvideo;audio/x-pn-windows-acm;video/divx;video/msvideo;video/vnd.divx;video/avi;video/x-avi;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;audio/vnd.rn-realaudio;audio/x-pn-realaudio;audio/x-pn-realaudio-plugin;audio/x-real-audio;audio/x-realaudio;video/vnd.rn-realvideo;audio/mpeg;audio/mpg;audio/mp1;audio/mp2;audio/mp3;audio/x-mp1;audio/x-mp2;audio/x-mp3;audio/x-mpeg;audio/x-mpg;video/mp2t;video/mpeg;video/mpeg-system;video/x-mpeg;video/x-mpeg2;video/x-mpeg-system;application/mpeg4-iod;application/mpeg4-muxcodetable;application/x-extension-m4a;application/x-extension-mp4;audio/aac;audio/m4a;audio/mp4;audio/x-m4a;audio/x-aac;video/mp4;video/mp4v-es;video/x-m4v;application/x-quicktime-media-link;application/x-quicktimeplayer;video/quicktime;application/x-matroska;audio/x-matroska;video/x-matroska;video/webm;audio/webm;audio/3gpp;audio/3gpp2;audio/AMR;audio/AMR-WB;video/3gp;video/3gpp;video/3gpp2;x-scheme-handler/mms;x-scheme-handler/mmsh;x-scheme-handler/rtsp;x-scheme-handler/rtp;x-scheme-handler/rtmp;x-scheme-handler/icy;x-scheme-handler/icyx;application/x-cd-image;x-content/video-vcd;x-content/video-svcd;x-content/video-dvd;x-content/audio-cdda;x-content/audio-player;application/ram;application/xspf+xml;audio/mpegurl;audio/x-mpegurl;audio/scpls;audio/x-scpls;text/google-video-pointer;text/x-google-video-pointer;video/vnd.mpegurl;application/vnd.apple.mpegurl;application/vnd.ms-asf;application/vnd.ms-wpl;application/sdp;audio/dv;video/dv;audio/x-aiff;audio/x-pn-aiff;video/x-anim;video/x-nsv;video/fli;video/flv;video/x-flc;video/x-fli;video/x-flv;audio/wav;audio/x-pn-au;audio/x-pn-wav;audio/x-wav;audio/x-adpcm;audio/ac3;audio/eac3;audio/vnd.dts;audio/vnd.dts.hd;audio/vnd.dolby.heaac.1;audio/vnd.dolby.heaac.2;audio/vnd.dolby.mlp;audio/basic;audio/midi;audio/x-ape;audio/x-gsm;audio/x-musepack;audio/x-tta;audio/x-wavpack;audio/x-shorten;application/x-shockwave-flash;application/x-flash-video;misc/ultravox;image/vnd.rn-realpix;audio/x-it;audio/x-mod;audio/x-s3m;audio/x-xm;application/mxf;
Name=Pineapple Music
StartupNotify=false
Type=Application
Terminal=false

View File

@ -11,5 +11,6 @@
<file>icons/window-minimize.png</file> <file>icons/window-minimize.png</file>
<file>icons/media-playback-pause.png</file> <file>icons/media-playback-pause.png</file>
<file>icons/audio-volume-muted.png</file> <file>icons/audio-volume-muted.png</file>
<file>icons/app-icon.svg</file>
</qresource> </qresource>
</RCC> </RCC>