diff --git a/LICENSES b/LICENSES index f2ad2d6f..5e043234 100644 --- a/LICENSES +++ b/LICENSES @@ -20,25 +20,25 @@ b) Cassowary constraint solving algorithm ( examples ) SPDX-License-Identifier: BSD 3-Clause "New" or "Revised" License Copyright (c) 2013, Nucleic Development Team -fonts ( only for running the examples ): +fonts ( needed for the Material3/Fluent2 skin ) a) Material3 Icons Code: https://github.com/google/material-design-icons SPDX-License-Identifier: Apache License 2.0 -b) Fluent2 Icons +b) Roboto Fonts + + Code: https://github.com/googlefonts/roboto-classic + SPDX-License-Identifier: SIL Open Font License 1.1 + Copyright 2011 The Roboto Project Authors + +c) Fluent2 Icons Code: https://github.com/microsoft/fluentui-system-icons SPDX-License-Identifier: MIT License -c) Segoe-UI Fonts +d) Segoe-UI Fonts Code: https://github.com/mrbvrz/segoe-ui-linux License: https://github.com/mrbvrz/segoe-ui-linux/blob/master/license.txt - -d) Font Awesome - - Code: https://fontawesome.com/ - SPDX-License-Identifier: OFL-1.1-RFN - Copyright (c) 2024 Fonticons, Inc. diff --git a/designsystems/fluent2/QskFluent2Skin.cpp b/designsystems/fluent2/QskFluent2Skin.cpp index e38340ce..a696d15c 100644 --- a/designsystems/fluent2/QskFluent2Skin.cpp +++ b/designsystems/fluent2/QskFluent2Skin.cpp @@ -703,9 +703,10 @@ void Editor::setupListViewMetrics() for ( auto state : { A::NoState, Q::Hovered, Q::Pressed } ) setBoxBorderMetrics( Q::Cell | state | Q::Selected, { 3_px, 0, 0, 0 } ); + #if 1 - // taken from M3 - what are the actual values, TODO ... - setPadding( Q::Cell, { 16_px, 12_px, 16_px, 12_px } ); + setPadding( Q::Cell, 4_px ); + setStrutSize( Q::Cell, -1, 40_px ); #endif } @@ -1561,9 +1562,6 @@ void Editor::setupSpinBoxMetrics() setSymbol( Q::UpIndicator, symbol( "chevron_up" ) ); setSymbol( Q::DownIndicator, symbol( "chevron_down" ) ); - setPadding( Q::UpPanel, { 0, 1_px, 0, 0 } ); - setPadding( Q::DownPanel, { 0, 0, 0, 1_px } ); - #if 0 // QskSpinBox::Pressed is missing yet setBoxBorderMetrics( Q::Panel | Q::Pressed, { 1_px, 1_px, 1_px, 2_px } ); diff --git a/designsystems/fluent2/README b/designsystems/fluent2/README new file mode 100644 index 00000000..81de77c0 --- /dev/null +++ b/designsystems/fluent2/README @@ -0,0 +1,26 @@ +Definitions ( where possible ) taken from: + - https://www.figma.com/file/NAWMapFlXnoOb86Q2H5GKr/Windows-UI-(Community) + +The Figma model uses the "Segoe Fluent Icons" [1]. Unfortunately its license is +too restrictive for being included in the QSkinny project. Fortunately similar +icons are also available from the "Fluent UI System Icons" project [2]. + +However glyph names/numbers and the corresponding unicode values do not match +and can't be taken 1:1 from the Figma model. + +"Fluent UI System Icons" offers different icon packages ( as font ): + + - FluentSystemIcons-Light.ttf + - FluentSystemIcons-Regular.ttf + - FluentSystemIcons-Filled.ttf + - FluentSystemIcons-Resizable.ttf + +For some reason ( might be a bug in the downloaded version ) the checkmark +glyph offered from the "Regular" font ( pixelsize 12 ) is different +( works better ) to the one from the "Resizable" font. + +That's why we decided to use the "Regular" font for now. + +[1] https://learn.microsoft.com/en-us/windows/apps/design/style/segoe-fluent-icons-font +[2] https://github.com/microsoft/fluentui-system-icons + diff --git a/designsystems/fluent2/icons/FluentSystemIcons-Regular.ttf b/designsystems/fluent2/icons/FluentSystemIcons-Regular.ttf new file mode 100644 index 00000000..fc3c648a Binary files /dev/null and b/designsystems/fluent2/icons/FluentSystemIcons-Regular.ttf differ diff --git a/designsystems/fluent2/icons/README b/designsystems/fluent2/icons/README deleted file mode 100644 index a45cea97..00000000 --- a/designsystems/fluent2/icons/README +++ /dev/null @@ -1,10 +0,0 @@ -SVGs have been taken from https://github.com/microsoft/fluentui-system-icons/tree/main/assets. - -Icons are available in different sizes. As SVGs can be scaled we only need -one version of them - chosing the '12'. - -As we are replacing the colors of the SVGs using graphic filters we set the -color in the SVGs manually to black ( instead of #212121 ). So they are in -line with icons coming from somewhere else. - -Names have been shortened ( ic_fluent_xyz_16_regular.svg -> xyz.svg ) diff --git a/designsystems/fluent2/icons/checkmark.svg b/designsystems/fluent2/icons/checkmark.svg deleted file mode 100644 index f87de9aa..00000000 --- a/designsystems/fluent2/icons/checkmark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/designsystems/fluent2/icons/chevron_down.svg b/designsystems/fluent2/icons/chevron_down.svg deleted file mode 100644 index 8ac9ed11..00000000 --- a/designsystems/fluent2/icons/chevron_down.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/designsystems/fluent2/icons/chevron_up.svg b/designsystems/fluent2/icons/chevron_up.svg deleted file mode 100644 index 28426e1d..00000000 --- a/designsystems/fluent2/icons/chevron_up.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/designsystems/fluent2/icons/icon2qvg.sh b/designsystems/fluent2/icons/icon2qvg.sh deleted file mode 100755 index c562ca17..00000000 --- a/designsystems/fluent2/icons/icon2qvg.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /bin/sh - -if [ $# -eq 0 ]; then - echo "Usage $0 file ..." - exit 1 -fi - -for file in $* -do - base=`basename -s .svg $file` - echo "${base}.svg -> qvg/${base}.qvg" - svg2qvg ${base}.svg qvg/${base}.qvg -done - -exit $status diff --git a/designsystems/fluent2/icons/qvg/checkmark.qvg b/designsystems/fluent2/icons/qvg/checkmark.qvg index 40ab0c75..e1e03bf0 100644 Binary files a/designsystems/fluent2/icons/qvg/checkmark.qvg and b/designsystems/fluent2/icons/qvg/checkmark.qvg differ diff --git a/designsystems/fluent2/icons/qvg/chevron_down.qvg b/designsystems/fluent2/icons/qvg/chevron_down.qvg index a8d90d49..d7957b36 100644 Binary files a/designsystems/fluent2/icons/qvg/chevron_down.qvg and b/designsystems/fluent2/icons/qvg/chevron_down.qvg differ diff --git a/designsystems/fluent2/icons/qvg/chevron_up.qvg b/designsystems/fluent2/icons/qvg/chevron_up.qvg index 11f3abc4..f5446475 100644 Binary files a/designsystems/fluent2/icons/qvg/chevron_up.qvg and b/designsystems/fluent2/icons/qvg/chevron_up.qvg differ diff --git a/designsystems/fluent2/icons/symbol2qvg.sh b/designsystems/fluent2/icons/symbol2qvg.sh new file mode 100755 index 00000000..21be8a82 --- /dev/null +++ b/designsystems/fluent2/icons/symbol2qvg.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +function symbol2qvg { + fontfile=FluentSystemIcons-Regular.ttf + glyph2qvg ${fontfile} 12 $1 qvg/$2.qvg +} + + +symbol2qvg 1724 checkmark +symbol2qvg 1792 chevron_down +symbol2qvg 1816 chevron_up diff --git a/designsystems/fusion/QskFusionSkin.cpp b/designsystems/fusion/QskFusionSkin.cpp index 4dd17a66..1879782a 100644 --- a/designsystems/fusion/QskFusionSkin.cpp +++ b/designsystems/fusion/QskFusionSkin.cpp @@ -1338,7 +1338,7 @@ void Editor::setupListView() using P = QPalette; // padding for each cell - setPadding( Q::Cell, QskMargins( 4, 0 ) ); + setPadding( Q::Cell, QskMargins( 4, 4 ) ); for ( auto state : { A::NoState, Q::Disabled } ) { diff --git a/designsystems/material3/QskMaterial3Icons.qrc b/designsystems/material3/QskMaterial3Icons.qrc index 72725b7a..d30484f9 100644 --- a/designsystems/material3/QskMaterial3Icons.qrc +++ b/designsystems/material3/QskMaterial3Icons.qrc @@ -1,21 +1,10 @@ - - - - icons/qvg/check_small.qvg - icons/qvg/combo-box-arrow-closed.qvg - icons/qvg/combo-box-arrow-open.qvg - icons/qvg/segmented-button-check.qvg - icons/qvg/switchbutton-checked.qvg - icons/qvg/switchbutton-unchecked.qvg - - - icons/qvg/add.qvg icons/qvg/arrow_drop_down.qvg icons/qvg/arrow_drop_up.qvg icons/qvg/check.qvg + icons/qvg/close.qvg icons/qvg/remove.qvg diff --git a/designsystems/material3/QskMaterial3Skin.cpp b/designsystems/material3/QskMaterial3Skin.cpp index c4b78be1..202158e5 100644 --- a/designsystems/material3/QskMaterial3Skin.cpp +++ b/designsystems/material3/QskMaterial3Skin.cpp @@ -227,7 +227,6 @@ void Editor::setupCheckBox() setStrutSize( Q::Box, 18_px, 18_px ); setBoxBorderMetrics( Q::Box, 2_px ); setBoxShape( Q::Box, 2_px ); - setPadding( Q::Box, 3_px ); // "icon size" QskShadowMetrics shadowMetrics( 12_px, 0.0 ); shadowMetrics.setShapeMode( QskShadowMetrics::Ellipse ); @@ -240,7 +239,7 @@ void Editor::setupCheckBox() setGraphicRole( Q::Indicator | Q::Disabled | Q::Checked, QskMaterial3Skin::GraphicRoleSurface ); - const auto checkMark = symbol( "check_small" ); + const auto checkMark = symbol( "check" ); for ( auto state : { A::NoState, Q::Disabled } ) { const auto aspect = Q::Indicator | Q::Checked | state; @@ -337,7 +336,7 @@ void Editor::setupComboBox() setColor( Q::Text, m_pal.onSurface ); setFontRole( Q::Text, BodyLarge ); - setStrutSize( Q::StatusIndicator, 12_px, 12_px ); + setStrutSize( Q::StatusIndicator, 24_px, 24_px ); setGraphicRole( Q::StatusIndicator, QskMaterial3Skin::GraphicRoleOnSurface ); setAlignment( Q::StatusIndicator, Qt::AlignRight | Qt::AlignVCenter ); @@ -346,14 +345,13 @@ void Editor::setupComboBox() setBoxBorderColors( Q::Panel | Q::Disabled, m_pal.onSurface38 ); - setGraphicRole( Q::Icon, QskMaterial3Skin::GraphicRoleOnSurface38 ); - setColor( Q::Text | Q::Disabled, m_pal.onSurface38 ); - setGraphicRole( Q::StatusIndicator, QskMaterial3Skin::GraphicRoleOnSurface38 ); + setGraphicRole( Q::StatusIndicator | Q::Disabled, QskMaterial3Skin::GraphicRoleOnSurface38 ); + setGraphicRole( Q::Icon | Q::Disabled, QskMaterial3Skin::GraphicRoleOnSurface38 ); - setSymbol( Q::StatusIndicator, symbol( "combo-box-arrow-closed" ) ); - setSymbol( Q::StatusIndicator | Q::PopupOpen, symbol( "combo-box-arrow-open" ) ); + setSymbol( Q::StatusIndicator, symbol( "arrow_drop_down" ) ); + setSymbol( Q::StatusIndicator | Q::PopupOpen, symbol( "arrow_drop_up" ) ); } void Editor::setupBox() @@ -1120,8 +1118,8 @@ void Editor::setupSwitchButton() setStrutSize( Q::Icon, { 16_px, 16_px } ); setPadding( Q::Icon, 6_px ); - setSymbol( Q::Icon, symbol( "switchbutton-unchecked" ) ); - setSymbol( Q::Icon | Q::Checked, symbol( "switchbutton-checked" ) ); + setSymbol( Q::Icon, symbol( "close" ) ); + setSymbol( Q::Icon | Q::Checked, symbol( "check" ) ); setGraphicRole( Q::Icon, QskMaterial3Skin::GraphicRoleSurfaceContainerHighest ); diff --git a/designsystems/material3/icons/LICENSE b/designsystems/material3/icons/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/designsystems/material3/icons/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/playground/iconbrowser/fonts/MaterialSymbolsOutlined.ttf b/designsystems/material3/icons/MaterialSymbolsOutlined.ttf similarity index 100% rename from playground/iconbrowser/fonts/MaterialSymbolsOutlined.ttf rename to designsystems/material3/icons/MaterialSymbolsOutlined.ttf diff --git a/designsystems/material3/icons/add.svg b/designsystems/material3/icons/add.svg deleted file mode 100644 index b0570646..00000000 --- a/designsystems/material3/icons/add.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/designsystems/material3/icons/arrow_drop_down.svg b/designsystems/material3/icons/arrow_drop_down.svg deleted file mode 100644 index 37d90c90..00000000 --- a/designsystems/material3/icons/arrow_drop_down.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/designsystems/material3/icons/arrow_drop_up.svg b/designsystems/material3/icons/arrow_drop_up.svg deleted file mode 100644 index 24f0831a..00000000 --- a/designsystems/material3/icons/arrow_drop_up.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/designsystems/material3/icons/check.svg b/designsystems/material3/icons/check.svg deleted file mode 100644 index 3be223be..00000000 --- a/designsystems/material3/icons/check.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/designsystems/material3/icons/check_small.svg b/designsystems/material3/icons/check_small.svg deleted file mode 100644 index e7a84071..00000000 --- a/designsystems/material3/icons/check_small.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/designsystems/material3/icons/combo-box-arrow-closed.svg b/designsystems/material3/icons/combo-box-arrow-closed.svg deleted file mode 100644 index c288b426..00000000 --- a/designsystems/material3/icons/combo-box-arrow-closed.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/designsystems/material3/icons/combo-box-arrow-open.svg b/designsystems/material3/icons/combo-box-arrow-open.svg deleted file mode 100644 index 4138c2cd..00000000 --- a/designsystems/material3/icons/combo-box-arrow-open.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/designsystems/material3/icons/icon2qvg.sh b/designsystems/material3/icons/icon2qvg.sh deleted file mode 100755 index c562ca17..00000000 --- a/designsystems/material3/icons/icon2qvg.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /bin/sh - -if [ $# -eq 0 ]; then - echo "Usage $0 file ..." - exit 1 -fi - -for file in $* -do - base=`basename -s .svg $file` - echo "${base}.svg -> qvg/${base}.qvg" - svg2qvg ${base}.svg qvg/${base}.qvg -done - -exit $status diff --git a/designsystems/material3/icons/qvg/add.qvg b/designsystems/material3/icons/qvg/add.qvg index de7e62c6..51de8ec1 100644 Binary files a/designsystems/material3/icons/qvg/add.qvg and b/designsystems/material3/icons/qvg/add.qvg differ diff --git a/designsystems/material3/icons/qvg/arrow_drop_down.qvg b/designsystems/material3/icons/qvg/arrow_drop_down.qvg index 496378d6..69e0301c 100644 Binary files a/designsystems/material3/icons/qvg/arrow_drop_down.qvg and b/designsystems/material3/icons/qvg/arrow_drop_down.qvg differ diff --git a/designsystems/material3/icons/qvg/arrow_drop_up.qvg b/designsystems/material3/icons/qvg/arrow_drop_up.qvg index 09b1976e..d48d7e7a 100644 Binary files a/designsystems/material3/icons/qvg/arrow_drop_up.qvg and b/designsystems/material3/icons/qvg/arrow_drop_up.qvg differ diff --git a/designsystems/material3/icons/qvg/check.qvg b/designsystems/material3/icons/qvg/check.qvg index 8fb73515..e72e8896 100644 Binary files a/designsystems/material3/icons/qvg/check.qvg and b/designsystems/material3/icons/qvg/check.qvg differ diff --git a/designsystems/material3/icons/qvg/check_small.qvg b/designsystems/material3/icons/qvg/check_small.qvg deleted file mode 100644 index 4b92ce5b..00000000 Binary files a/designsystems/material3/icons/qvg/check_small.qvg and /dev/null differ diff --git a/designsystems/material3/icons/qvg/close.qvg b/designsystems/material3/icons/qvg/close.qvg new file mode 100644 index 00000000..fa97264e Binary files /dev/null and b/designsystems/material3/icons/qvg/close.qvg differ diff --git a/designsystems/material3/icons/qvg/combo-box-arrow-closed.qvg b/designsystems/material3/icons/qvg/combo-box-arrow-closed.qvg deleted file mode 100644 index 83f33a45..00000000 Binary files a/designsystems/material3/icons/qvg/combo-box-arrow-closed.qvg and /dev/null differ diff --git a/designsystems/material3/icons/qvg/combo-box-arrow-open.qvg b/designsystems/material3/icons/qvg/combo-box-arrow-open.qvg deleted file mode 100644 index 1e757789..00000000 Binary files a/designsystems/material3/icons/qvg/combo-box-arrow-open.qvg and /dev/null differ diff --git a/designsystems/material3/icons/qvg/remove.qvg b/designsystems/material3/icons/qvg/remove.qvg index 6598d5b0..b038b3fa 100644 Binary files a/designsystems/material3/icons/qvg/remove.qvg and b/designsystems/material3/icons/qvg/remove.qvg differ diff --git a/designsystems/material3/icons/qvg/segmented-button-check.qvg b/designsystems/material3/icons/qvg/segmented-button-check.qvg deleted file mode 100644 index 1b0148e3..00000000 Binary files a/designsystems/material3/icons/qvg/segmented-button-check.qvg and /dev/null differ diff --git a/designsystems/material3/icons/qvg/switchbutton-checked.qvg b/designsystems/material3/icons/qvg/switchbutton-checked.qvg deleted file mode 100644 index c927ddb3..00000000 Binary files a/designsystems/material3/icons/qvg/switchbutton-checked.qvg and /dev/null differ diff --git a/designsystems/material3/icons/qvg/switchbutton-unchecked.qvg b/designsystems/material3/icons/qvg/switchbutton-unchecked.qvg deleted file mode 100644 index b33f61e4..00000000 Binary files a/designsystems/material3/icons/qvg/switchbutton-unchecked.qvg and /dev/null differ diff --git a/designsystems/material3/icons/remove.svg b/designsystems/material3/icons/remove.svg deleted file mode 100644 index 9fa856a5..00000000 --- a/designsystems/material3/icons/remove.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/designsystems/material3/icons/segmented-button-check.svg b/designsystems/material3/icons/segmented-button-check.svg deleted file mode 100644 index b0b66ac9..00000000 --- a/designsystems/material3/icons/segmented-button-check.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/designsystems/material3/icons/switchbutton-checked.svg b/designsystems/material3/icons/switchbutton-checked.svg deleted file mode 100644 index 7f4d9275..00000000 --- a/designsystems/material3/icons/switchbutton-checked.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/designsystems/material3/icons/switchbutton-unchecked.svg b/designsystems/material3/icons/switchbutton-unchecked.svg deleted file mode 100644 index a9e2ee7e..00000000 --- a/designsystems/material3/icons/switchbutton-unchecked.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/designsystems/material3/icons/symbol2qvg.sh b/designsystems/material3/icons/symbol2qvg.sh new file mode 100755 index 00000000..46597425 --- /dev/null +++ b/designsystems/material3/icons/symbol2qvg.sh @@ -0,0 +1,15 @@ +#! /bin/sh + +function symbol2qvg { + fontfile=MaterialSymbolsOutlined.ttf + glyph2qvg ${fontfile} 24 $1 qvg/$2.qvg +} + +symbol2qvg 3067 check +symbol2qvg 3084 close + +symbol2qvg 5022 arrow_drop_down +symbol2qvg 5023 arrow_drop_up + +symbol2qvg 3082 add +symbol2qvg 3080 remove diff --git a/playground/iconbrowser/GlyphListView.cpp b/playground/iconbrowser/GlyphListView.cpp index 70fc9f90..b93e1e01 100644 --- a/playground/iconbrowser/GlyphListView.cpp +++ b/playground/iconbrowser/GlyphListView.cpp @@ -12,7 +12,7 @@ #include #include -constexpr int glyphSize = 100; +constexpr int glyphSize = 20; GlyphListView::GlyphListView( QQuickItem* parentItem ) : Inherited( parentItem ) @@ -85,7 +85,13 @@ qreal GlyphListView::columnWidth( int col ) const } case 1: - return glyphSize; + { + const auto hint = strutSizeHint( Cell ); + const auto padding = paddingHint( Cell ); + + const qreal w = glyphSize + padding.left() + padding.right(); + return qMax( w, hint.width() ); + } case 2: return m_maxNameWidth; @@ -96,7 +102,11 @@ qreal GlyphListView::columnWidth( int col ) const qreal GlyphListView::rowHeight() const { - return glyphSize + 20; + const auto hint = strutSizeHint( Cell ); + const auto padding = paddingHint( Cell ); + + const qreal h = glyphSize + padding.top() + padding.bottom(); + return qMax( h, hint.height() ); } QVariant GlyphListView::valueAt( int row, int col ) const diff --git a/playground/iconbrowser/fonts.qrc b/playground/iconbrowser/fonts.qrc index 2a0a4935..1bcb1237 100644 --- a/playground/iconbrowser/fonts.qrc +++ b/playground/iconbrowser/fonts.qrc @@ -1,10 +1,10 @@ - fonts/FluentSystemIcons-Resizable.ttf + ../../designsystems/fluent2/icons/FluentSystemIcons-Regular.ttf fonts/Font Awesome 6 Free-Regular-400.otf fonts/IcoMoon-Free.ttf - fonts/MaterialSymbolsOutlined.ttf + ../../designsystems/material3/icons/MaterialSymbolsOutlined.ttf fonts/Octicons.ttf diff --git a/playground/iconbrowser/fonts/FluentSystemIcons-Resizable.ttf b/playground/iconbrowser/fonts/FluentSystemIcons-Resizable.ttf deleted file mode 100644 index b8f87598..00000000 Binary files a/playground/iconbrowser/fonts/FluentSystemIcons-Resizable.ttf and /dev/null differ diff --git a/tools/glyph2qvg/main.cpp b/tools/glyph2qvg/main.cpp index ba3053c5..9d1a2cbe 100644 --- a/tools/glyph2qvg/main.cpp +++ b/tools/glyph2qvg/main.cpp @@ -21,56 +21,87 @@ #include #include +enum Options +{ + ViewBox = 1 << 0, + Antialiasing = 1 << 1 +}; + static void usage( const char* appName ) { - qWarning() << "usage: " << appName << " "; + qWarning() << "usage: " << appName << " "; +} + +static QPainterPath glyphPath( const QRawFont& font, + const qreal pixelSize, const uint glyphIndex ) +{ + auto path = font.pathForGlyph( glyphIndex ); + path = path.simplified(); + path = path.translated( 0.0, pixelSize ); + + return path; +} + +static QskGraphic icon( const QPainterPath& path, + const qreal pixelSize, const int options ) +{ + QskGraphic graphic; + + if ( options & ViewBox ) + graphic.setViewBox( QRectF( 0.0, 0.0, pixelSize, pixelSize ) ); + + QPainter painter( &graphic ); + + if ( options & Antialiasing ) + painter.setRenderHint( QPainter::Antialiasing, true ); + + painter.fillPath( path, Qt::black ); + + return graphic; } int main( int argc, char* argv[] ) { - if ( argc != 4 ) + QGuiApplication app( argc, argv ); + + if ( argc != 5 ) { usage( argv[0] ); return -1; } - const int sz = 24; // something + bool ok; - QGuiApplication app( argc, argv ); + const auto pixelSize = QString( argv[2] ).toDouble( &ok ); + if ( !ok || ( pixelSize <= 0 ) ) + { + qWarning() << "invalid pixel size:" << argv[2]; + return -3; + } - QRawFont font( QString( argv[1] ), sz ); + const auto glyphIndex = QString( argv[3] ).toUInt( &ok ); + if ( !ok ) + { + qWarning() << "invalid glyph index:" << argv[3]; + return -3; + } + + QRawFont font( QString( argv[1] ), pixelSize ); if ( !font.isValid() ) { qWarning() << "invalid font name:" << argv[1]; return -2; } - bool ok; - - const auto glyphIndex = QString( argv[2] ).toUInt( &ok ); - if ( !ok ) - { - qWarning() << "invalid glyph index:" << argv[2]; - return -3; - } - - const auto path = font.pathForGlyph( glyphIndex ); + const auto path = glyphPath( font, pixelSize, glyphIndex ); if ( path.isEmpty() ) { - qWarning() << "no glyph for index:" << argv[2]; + qWarning() << "no glyph for index:" << argv[3]; return -3; } - QskGraphic graphic; - - // vertical glyph coordinates are in the range [-sz, 0.0] - graphic.setViewBox( QRectF( 0.0, -sz, sz, sz ) ); - - QPainter painter( &graphic ); - painter.setRenderHint( QPainter::Antialiasing, true ); - painter.fillPath( path, Qt::black ); - - QskGraphicIO::write( graphic, argv[3] ); + const auto graphic = icon( path, pixelSize, ViewBox | Antialiasing ); + QskGraphicIO::write( graphic, argv[4] ); return 0; }