Skip to content

Commit

Permalink
add taskbar / titlebar icon on Linux & Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaslepoix committed Sep 7, 2024
1 parent a3eb238 commit 116f7aa
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ indent_size = 4
indent_style = tab
tab_width = 4

[*.{json,nix,yml}]
[*.{json,nix,qrc,yml}]
indent_size = 2
indent_style = space
indent_style = space
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ set( QUCS-RF-LAYOUT_SRCS
"${CMAKE_SOURCE_DIR}/src/converter.cpp"
"$<$<NOT:$<BOOL:${QRFL_MINIMAL}>>:${CMAKE_SOURCE_DIR}/src/preview.cpp>"
"$<$<NOT:$<BOOL:${QRFL_MINIMAL}>>:${CMAKE_SOURCE_DIR}/src/mainwindow.cpp>"
"$<$<NOT:$<BOOL:${QRFL_MINIMAL}>>:${CMAKE_SOURCE_DIR}/src/resources.qrc>"
"$<$<NOT:$<BOOL:${QRFL_MINIMAL}>>:${CMAKE_SOURCE_DIR}/pack/qucsrflayout.rc>"
"${CMAKE_SOURCE_DIR}/src/main.cpp"
)

Expand Down Expand Up @@ -223,6 +225,7 @@ set_target_properties( ${PROJECT_NAME} PROPERTIES
if( NOT QRFL_MINIMAL )
set_target_properties( ${PROJECT_NAME} PROPERTIES
AUTOMOC ON
AUTORCC ON
AUTOUIC ON
)
endif( NOT QRFL_MINIMAL )
Expand Down
Binary file added pack/icons/qucsrflayout.ico
Binary file not shown.
1 change: 1 addition & 0 deletions pack/qucsrflayout.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IDI_ICON1 ICON "icons/qucsrflayout.ico"
4 changes: 4 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ MainWindow::MainWindow(Data& _data, QWidget* parent) :
for(std::string used : data.used_elements) {
add_action("Use", QString::fromStdString(used));
}

#ifndef __APPLE__
setWindowIcon(QPixmap(":/qucsrflayout.ico"));
#endif // __APPLE__
}

//******************************************************************************
Expand Down
17 changes: 17 additions & 0 deletions src/resources.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<RCC>
<qresource prefix="/">
<!--
convert \
qucsrflayout.16x16.png \
qucsrflayout.22x22.png \
qucsrflayout.32x32.png \
qucsrflayout.48x48.png \
qucsrflayout.64x64.png \
qucsrflayout.128x128.png \
qucsrflayout.256x256.png \
qucsrflayout.512x512.png \
qucsrflayout.ico
-->
<file alias="qucsrflayout.ico">../pack/icons/qucsrflayout.ico</file>
</qresource>
</RCC>

0 comments on commit 116f7aa

Please sign in to comment.