Compare commits

...

4 Commits

50 changed files with 1276 additions and 641 deletions

@ -1 +1 @@
Subproject commit fd7734e79071d0acc1286004dc53db8c9b8c5a1a
Subproject commit 489650df0eea78db580c9338406abd4dd9718780

View File

@ -45,7 +45,7 @@ endif()
add_subdirectory(lib_source)
if (RIBBONUI_BUILD_EXAMPLES)
add_subdirectory(example)
add_subdirectory(RibbonUIAPP)
endif()
message("---------------------------- RibbonUI ----------------------------")

View File

@ -37,7 +37,12 @@ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Quick LinguistTools REQUIRED)
set(ts_files i18n/${PROJECT_NAME}_zh_CN.ts i18n/${PROJECT_NAME}_en_US.ts)
# Source and QML files
set(sources_files example.cpp)
set(sources_files
source/example.cpp
)
set(module_sources_files
include/localization.h source/localization.cpp
)
set(qml_files example.qml about.qml SplashScreen.qml
components/RibbonMessageListViewExample.qml
pages/SettingsMenuPage.qml components/TabBar.qml)
@ -127,6 +132,15 @@ endif()
# Include Qt5 QML plugin for Qt versions less than 6
if (${QT_VERSION_MAJOR} LESS 6)
include(Qt5QMLPlugin)
else()
# Update QML_IMPORT_PATH (cached variable)
if(NOT QML_IMPORT_PATH MATCHES "(^|;)${CMAKE_CURRENT_BINARY_DIR}($|;)")
if(QML_IMPORT_PATH)
set(QML_IMPORT_PATH "${QML_IMPORT_PATH};${CMAKE_CURRENT_BINARY_DIR}" CACHE STRING "Set for Qt Creator" FORCE)
else()
set(QML_IMPORT_PATH "${CMAKE_CURRENT_BINARY_DIR}" CACHE STRING "Set for Qt Creator" FORCE)
endif()
endif()
endif()
# Define the QML module
@ -135,6 +149,7 @@ qt_add_qml_module(${PROJECT_NAME}
VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
RESOURCE_PREFIX "/qt/qml/"
QML_FILES ${qml_files}
SOURCES ${module_sources_files}
RESOURCES resources/imgs/heart.png resources/imgs/search.png
)
@ -183,4 +198,11 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_SOURCE_DIR})
target_include_directories(${PROJECT_NAME} PUBLIC
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/include
)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(${PROJECT_NAME} PRIVATE QT_QML_DEBUG)
endif()

View File

@ -1,6 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>RibbonBackStageView</name>
<message>
<location filename="../qml/Qt6/example.qml" line="378"/>
<source>Home</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="385"/>
<source>File</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="392"/>
<source>Search</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="399"/>
<source>Account</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="406"/>
<source>About</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="413"/>
<source>Settings</source>
<translation></translation>
</message>
</context>
<context>
<name>RibbonMessageListViewExample</name>
<message>
@ -22,377 +55,508 @@
<translation></translation>
</message>
</context>
<context>
<name>RibbonSplashScreen</name>
<message>
<location filename="../qml/Qt6/SplashScreen.qml" line="12"/>
<source>Example App</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/SplashScreen.qml" line="13"/>
<source>A example for users to use RibbonUI.</source>
<translation></translation>
</message>
</context>
<context>
<name>RibbonTabBar</name>
<message>
<location filename="../qml/Qt6/components/TabBar.qml" line="38"/>
<source>Basic</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/components/TabBar.qml" line="331"/>
<source>Input</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/components/TabBar.qml" line="507"/>
<source>Progress</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/components/TabBar.qml" line="669"/>
<source>Indicator</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/components/TabBar.qml" line="725"/>
<source>Views</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/components/TabBar.qml" line="745"/>
<source>Others</source>
<translation></translation>
</message>
</context>
<context>
<name>RibbonTour</name>
<message>
<location filename="../qml/Qt6/example.qml" line="71"/>
<source>Tab Bar</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="72"/>
<source>A tab bar for window, let user choose the controllers.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="80"/>
<source>Tab Bar Buttons</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="81"/>
<source>Tool buttons at the top of tab bar.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="85"/>
<source>Sliders</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="86"/>
<source>Vertical/Horizental sliders with/without buttons.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="100"/>
<source>Switch Buttons</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="101"/>
<source>Switch buttons with/without background color or grabber text.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="107"/>
<source>CheckBoxs</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="108"/>
<source>CheckBoxs with colorful background or with/without label text.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="112"/>
<source>Buttons</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="113"/>
<source>Buttons with/without background or label text.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="119"/>
<source>Push Buttons</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="120"/>
<source>Push buttons with/without sub menu.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="124"/>
<source>Line Edits</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="125"/>
<source>Line edits with/without icon.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="139"/>
<source>Bottom Bar</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="140"/>
<source>A bottom bar for window.</source>
<translation></translation>
</message>
</context>
<context>
<name>SettingsMenuPage</name>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="9"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="9"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="10"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="10"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="21"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="21"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="22"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="22"/>
<source>Theme</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="25"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="25"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="26"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="26"/>
<source>Current Theme: </source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="52"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="52"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="53"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="53"/>
<source>Current Style: </source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="55"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="55"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="56"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="56"/>
<source>Style</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="56"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="56"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="57"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="57"/>
<source>Modern</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="56"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="56"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="57"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="57"/>
<source>Classic</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="67"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="67"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="68"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="68"/>
<source>Text Render</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="70"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="70"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="71"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="71"/>
<source>Current Text Render: </source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="74"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="74"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="75"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="75"/>
<source>Render</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="88"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="88"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="89"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="89"/>
<source>TitleBar</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="91"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="91"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="92"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="92"/>
<source>Show TitleBar Icon: </source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="94"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="94"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="95"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="95"/>
<source>Icon</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="108"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="108"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="109"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="109"/>
<source>Language</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="112"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="112"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="113"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="113"/>
<source>Current Language: </source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="31"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="45"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="31"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="45"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="32"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="46"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="32"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="46"/>
<source>Light</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="32"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="45"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="32"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="45"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="33"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="46"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="33"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="46"/>
<source>Dark</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="33"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="45"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="33"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="45"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="34"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="46"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="34"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="46"/>
<source>System</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="75"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="75"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="76"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="76"/>
<source>Native</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="75"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="75"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="76"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="76"/>
<source>Qt</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="95"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="95"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="96"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="96"/>
<source>Show</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="95"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="95"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="96"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="96"/>
<source>Hide</source>
<translation></translation>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<location filename="../qml/Qt5/SplashScreen.qml" line="11"/>
<location filename="../qml/Qt6/SplashScreen.qml" line="11"/>
<source>Example App</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/Qt5/SplashScreen.qml" line="12"/>
<location filename="../qml/Qt6/SplashScreen.qml" line="12"/>
<source>A example for users to use RibbonUI.</source>
<translation type="unfinished"></translation>
<source>Example App</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/SplashScreen.qml" line="23"/>
<location filename="../qml/Qt6/SplashScreen.qml" line="23"/>
<location filename="../qml/Qt5/SplashScreen.qml" line="13"/>
<source>A example for users to use RibbonUI.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/SplashScreen.qml" line="26"/>
<location filename="../qml/Qt6/SplashScreen.qml" line="24"/>
<source>Loading...Remain %1s...</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
</context>
<context>
<name>TabBar</name>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="38"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="37"/>
<source>Basic</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="42"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="41"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="69"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="69"/>
<source>Slider</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="82"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="81"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="109"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="109"/>
<source>Switch Button</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="131"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="130"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="159"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="159"/>
<source>CheckBox</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="167"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="166"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="196"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="196"/>
<source>Button</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="236"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="235"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="267"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="267"/>
<source>Push Button</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="243"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="260"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="242"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="259"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="275"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="292"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="275"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="292"/>
<source>No Menu</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="248"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="265"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="719"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="247"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="264"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="718"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="280"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="297"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="771"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="280"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="297"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="771"/>
<source>Menu</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="280"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="279"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="312"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="312"/>
<source>Radio Button</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="298"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="297"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="331"/>
<source>Input</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="301"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="300"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="344"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="344"/>
<source>Line Edit</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="332"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="331"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="377"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="377"/>
<source>Text Edit</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="366"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="365"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="411"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="411"/>
<source>Combo Box</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="426"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="425"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="471"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="471"/>
<source>Spin Box</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="461"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="460"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="507"/>
<source>Progress</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="475"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="474"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="527"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="527"/>
<source>ProgressBar</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="542"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="541"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="594"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="594"/>
<source>ProgressRing</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="617"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="616"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="669"/>
<source>Indicator</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="619"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="618"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="671"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="671"/>
<source>BusyRing</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="635"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="634"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="687"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="687"/>
<source>BusyBar</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="653"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="652"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="705"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="705"/>
<source>PageIndicator</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="673"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="672"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="725"/>
<source>Views</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="676"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="675"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="728"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="728"/>
<source>MessageListView</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="683"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="682"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="735"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="735"/>
<source>Open Message List View</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="693"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="692"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="745"/>
<source>Others</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="696"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="695"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="748"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="748"/>
<source>Text</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="726"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="725"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="778"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="778"/>
<source>Open Menu</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="734"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="733"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="786"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="786"/>
<source>Popup</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="744"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="743"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="796"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="796"/>
<source>Open Popup</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="749"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="748"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="801"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="801"/>
<source>Open Popup Dialog (Double Choices)</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="757"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="756"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="809"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="809"/>
<source>Open Popup Dialog (Triple Choices)</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="783"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="782"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="835"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="835"/>
<source>MessageBar</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="790"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="789"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="842"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="842"/>
<source>Generate One Message</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="797"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="796"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="849"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="849"/>
<source>Clear All Messages</source>
<translation></translation>
</message>
@ -409,178 +573,154 @@
<context>
<name>example</name>
<message>
<location filename="../qml/Qt5/example.qml" line="12"/>
<location filename="../qml/Qt6/example.qml" line="12"/>
<location filename="../qml/Qt5/example.qml" line="13"/>
<location filename="../qml/Qt6/example.qml" line="13"/>
<source>RibbonUI APP</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="70"/>
<location filename="../qml/Qt6/example.qml" line="70"/>
<location filename="../qml/Qt5/example.qml" line="71"/>
<source>Tab Bar</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="71"/>
<location filename="../qml/Qt6/example.qml" line="71"/>
<location filename="../qml/Qt5/example.qml" line="72"/>
<source>A tab bar for window, let user choose the controllers.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="79"/>
<location filename="../qml/Qt6/example.qml" line="79"/>
<location filename="../qml/Qt5/example.qml" line="80"/>
<source>Tab Bar Buttons</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="80"/>
<location filename="../qml/Qt6/example.qml" line="80"/>
<location filename="../qml/Qt5/example.qml" line="81"/>
<source>Tool buttons at the top of tab bar.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="84"/>
<location filename="../qml/Qt6/example.qml" line="84"/>
<location filename="../qml/Qt5/example.qml" line="85"/>
<source>Sliders</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="85"/>
<location filename="../qml/Qt6/example.qml" line="85"/>
<location filename="../qml/Qt5/example.qml" line="86"/>
<source>Vertical/Horizental sliders with/without buttons.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="99"/>
<location filename="../qml/Qt6/example.qml" line="99"/>
<location filename="../qml/Qt5/example.qml" line="100"/>
<source>Switch Buttons</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="100"/>
<location filename="../qml/Qt6/example.qml" line="100"/>
<location filename="../qml/Qt5/example.qml" line="101"/>
<source>Switch buttons with/without background color or grabber text.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="106"/>
<location filename="../qml/Qt6/example.qml" line="106"/>
<location filename="../qml/Qt5/example.qml" line="107"/>
<source>CheckBoxs</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="107"/>
<location filename="../qml/Qt6/example.qml" line="107"/>
<location filename="../qml/Qt5/example.qml" line="108"/>
<source>CheckBoxs with colorful background or with/without label text.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="111"/>
<location filename="../qml/Qt6/example.qml" line="111"/>
<location filename="../qml/Qt5/example.qml" line="112"/>
<source>Buttons</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="112"/>
<location filename="../qml/Qt6/example.qml" line="112"/>
<location filename="../qml/Qt5/example.qml" line="113"/>
<source>Buttons with/without background or label text.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="118"/>
<location filename="../qml/Qt6/example.qml" line="118"/>
<location filename="../qml/Qt5/example.qml" line="119"/>
<source>Push Buttons</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="119"/>
<location filename="../qml/Qt6/example.qml" line="119"/>
<location filename="../qml/Qt5/example.qml" line="120"/>
<source>Push buttons with/without sub menu.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="123"/>
<location filename="../qml/Qt6/example.qml" line="123"/>
<location filename="../qml/Qt5/example.qml" line="124"/>
<source>Line Edits</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="124"/>
<location filename="../qml/Qt6/example.qml" line="124"/>
<location filename="../qml/Qt5/example.qml" line="125"/>
<source>Line edits with/without icon.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="138"/>
<location filename="../qml/Qt6/example.qml" line="138"/>
<location filename="../qml/Qt5/example.qml" line="139"/>
<source>Bottom Bar</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="139"/>
<location filename="../qml/Qt6/example.qml" line="139"/>
<location filename="../qml/Qt5/example.qml" line="140"/>
<source>A bottom bar for window.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="288"/>
<location filename="../qml/Qt5/example.qml" line="406"/>
<location filename="../qml/Qt6/example.qml" line="288"/>
<location filename="../qml/Qt6/example.qml" line="406"/>
<location filename="../qml/Qt5/example.qml" line="290"/>
<location filename="../qml/Qt5/example.qml" line="408"/>
<location filename="../qml/Qt6/example.qml" line="290"/>
<source>About</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="299"/>
<location filename="../qml/Qt6/example.qml" line="299"/>
<location filename="../qml/Qt5/example.qml" line="301"/>
<location filename="../qml/Qt6/example.qml" line="301"/>
<source>Tour</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="333"/>
<location filename="../qml/Qt6/example.qml" line="333"/>
<location filename="../qml/Qt5/example.qml" line="335"/>
<location filename="../qml/Qt6/example.qml" line="335"/>
<source>Test Item 2</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="334"/>
<location filename="../qml/Qt6/example.qml" line="334"/>
<location filename="../qml/Qt5/example.qml" line="336"/>
<location filename="../qml/Qt6/example.qml" line="336"/>
<source>Test Item 3</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="378"/>
<location filename="../qml/Qt5/example.qml" line="382"/>
<location filename="../qml/Qt6/example.qml" line="378"/>
<location filename="../qml/Qt5/example.qml" line="380"/>
<location filename="../qml/Qt5/example.qml" line="384"/>
<location filename="../qml/Qt6/example.qml" line="382"/>
<source>Home</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="385"/>
<location filename="../qml/Qt5/example.qml" line="389"/>
<location filename="../qml/Qt6/example.qml" line="385"/>
<location filename="../qml/Qt5/example.qml" line="387"/>
<location filename="../qml/Qt5/example.qml" line="391"/>
<location filename="../qml/Qt6/example.qml" line="389"/>
<source>File</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="392"/>
<location filename="../qml/Qt5/example.qml" line="396"/>
<location filename="../qml/Qt6/example.qml" line="392"/>
<location filename="../qml/Qt5/example.qml" line="394"/>
<location filename="../qml/Qt5/example.qml" line="398"/>
<location filename="../qml/Qt6/example.qml" line="396"/>
<source>Search</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="399"/>
<location filename="../qml/Qt6/example.qml" line="399"/>
<location filename="../qml/Qt5/example.qml" line="401"/>
<source>Account</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="413"/>
<location filename="../qml/Qt6/example.qml" line="413"/>
<location filename="../qml/Qt5/example.qml" line="415"/>
<source>Settings</source>
<translation></translation>
</message>

View File

@ -1,6 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_CN">
<context>
<name>RibbonBackStageView</name>
<message>
<location filename="../qml/Qt6/example.qml" line="378"/>
<source>Home</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="385"/>
<source>File</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="392"/>
<source>Search</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="399"/>
<source>Account</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="406"/>
<source>About</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="413"/>
<source>Settings</source>
<translation></translation>
</message>
</context>
<context>
<name>RibbonMessageListViewExample</name>
<message>
@ -22,143 +55,282 @@
<translation></translation>
</message>
</context>
<context>
<name>RibbonSplashScreen</name>
<message>
<location filename="../qml/Qt6/SplashScreen.qml" line="12"/>
<source>Example App</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/SplashScreen.qml" line="13"/>
<source>A example for users to use RibbonUI.</source>
<translation>使RibbonUI的示例程序</translation>
</message>
</context>
<context>
<name>RibbonTabBar</name>
<message>
<location filename="../qml/Qt6/components/TabBar.qml" line="38"/>
<source>Basic</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/components/TabBar.qml" line="331"/>
<source>Input</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/components/TabBar.qml" line="507"/>
<source>Progress</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/components/TabBar.qml" line="669"/>
<source>Indicator</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/components/TabBar.qml" line="725"/>
<source>Views</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/components/TabBar.qml" line="745"/>
<source>Others</source>
<translation></translation>
</message>
</context>
<context>
<name>RibbonTour</name>
<message>
<location filename="../qml/Qt6/example.qml" line="71"/>
<source>Tab Bar</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="72"/>
<source>A tab bar for window, let user choose the controllers.</source>
<translation>使</translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="80"/>
<source>Tab Bar Buttons</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="81"/>
<source>Tool buttons at the top of tab bar.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="85"/>
<source>Sliders</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="86"/>
<source>Vertical/Horizental sliders with/without buttons.</source>
<translation>//</translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="100"/>
<source>Switch Buttons</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="101"/>
<source>Switch buttons with/without background color or grabber text.</source>
<translation>/</translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="107"/>
<source>CheckBoxs</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="108"/>
<source>CheckBoxs with colorful background or with/without label text.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="112"/>
<source>Buttons</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="113"/>
<source>Buttons with/without background or label text.</source>
<translation>/</translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="119"/>
<source>Push Buttons</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="120"/>
<source>Push buttons with/without sub menu.</source>
<translation>/</translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="124"/>
<source>Line Edits</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="125"/>
<source>Line edits with/without icon.</source>
<translation>/</translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="139"/>
<source>Bottom Bar</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt6/example.qml" line="140"/>
<source>A bottom bar for window.</source>
<translation></translation>
</message>
</context>
<context>
<name>SettingsMenuPage</name>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="9"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="9"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="10"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="10"/>
<source>Settings</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="21"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="21"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="22"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="22"/>
<source>Theme</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="25"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="25"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="26"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="26"/>
<source>Current Theme: </source>
<translation> </translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="52"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="52"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="53"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="53"/>
<source>Current Style: </source>
<translation> </translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="55"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="55"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="56"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="56"/>
<source>Style</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="56"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="56"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="57"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="57"/>
<source>Modern</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="56"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="56"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="57"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="57"/>
<source>Classic</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="67"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="67"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="68"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="68"/>
<source>Text Render</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="70"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="70"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="71"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="71"/>
<source>Current Text Render: </source>
<translation> </translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="74"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="74"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="75"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="75"/>
<source>Render</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="88"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="88"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="89"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="89"/>
<source>TitleBar</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="91"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="91"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="92"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="92"/>
<source>Show TitleBar Icon: </source>
<translation> </translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="94"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="94"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="95"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="95"/>
<source>Icon</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="108"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="108"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="109"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="109"/>
<source>Language</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="112"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="112"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="113"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="113"/>
<source>Current Language: </source>
<translation> </translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="31"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="45"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="31"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="45"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="32"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="46"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="32"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="46"/>
<source>Light</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="32"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="45"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="32"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="45"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="33"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="46"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="33"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="46"/>
<source>Dark</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="33"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="45"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="33"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="45"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="34"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="46"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="34"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="46"/>
<source>System</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="75"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="75"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="76"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="76"/>
<source>Native</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="75"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="75"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="76"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="76"/>
<source>Qt</source>
<translation>Qt</translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="95"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="95"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="96"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="96"/>
<source>Show</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="95"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="95"/>
<location filename="../qml/Qt5/pages/SettingsMenuPage.qml" line="96"/>
<location filename="../qml/Qt6/pages/SettingsMenuPage.qml" line="96"/>
<source>Hide</source>
<translation></translation>
</message>
@ -166,20 +338,18 @@
<context>
<name>SplashScreen</name>
<message>
<location filename="../qml/Qt5/SplashScreen.qml" line="11"/>
<location filename="../qml/Qt6/SplashScreen.qml" line="11"/>
<location filename="../qml/Qt5/SplashScreen.qml" line="12"/>
<source>Example App</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/SplashScreen.qml" line="12"/>
<location filename="../qml/Qt6/SplashScreen.qml" line="12"/>
<location filename="../qml/Qt5/SplashScreen.qml" line="13"/>
<source>A example for users to use RibbonUI.</source>
<translation>使RibbonUI的示例程序</translation>
</message>
<message>
<location filename="../qml/Qt5/SplashScreen.qml" line="23"/>
<location filename="../qml/Qt6/SplashScreen.qml" line="23"/>
<location filename="../qml/Qt5/SplashScreen.qml" line="26"/>
<location filename="../qml/Qt6/SplashScreen.qml" line="24"/>
<source>Loading...Remain %1s...</source>
<translation>... %1...</translation>
</message>
@ -188,211 +358,205 @@
<name>TabBar</name>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="38"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="37"/>
<source>Basic</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="42"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="41"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="69"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="69"/>
<source>Slider</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="82"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="81"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="109"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="109"/>
<source>Switch Button</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="131"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="130"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="159"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="159"/>
<source>CheckBox</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="167"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="166"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="196"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="196"/>
<source>Button</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="236"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="235"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="267"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="267"/>
<source>Push Button</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="243"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="260"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="242"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="259"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="275"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="292"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="275"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="292"/>
<source>No Menu</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="248"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="265"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="719"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="247"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="264"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="718"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="280"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="297"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="771"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="280"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="297"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="771"/>
<source>Menu</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="280"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="279"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="312"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="312"/>
<source>Radio Button</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="298"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="297"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="331"/>
<source>Input</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="301"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="300"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="344"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="344"/>
<source>Line Edit</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="332"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="331"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="377"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="377"/>
<source>Text Edit</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="366"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="365"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="411"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="411"/>
<source>Combo Box</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="426"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="425"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="471"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="471"/>
<source>Spin Box</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="461"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="460"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="507"/>
<source>Progress</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="475"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="474"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="527"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="527"/>
<source>ProgressBar</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="542"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="541"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="594"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="594"/>
<source>ProgressRing</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="617"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="616"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="669"/>
<source>Indicator</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="619"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="618"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="671"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="671"/>
<source>BusyRing</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="635"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="634"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="687"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="687"/>
<source>BusyBar</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="653"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="652"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="705"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="705"/>
<source>PageIndicator</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="673"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="672"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="725"/>
<source>Views</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="676"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="675"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="728"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="728"/>
<source>MessageListView</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="683"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="682"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="735"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="735"/>
<source>Open Message List View</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="693"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="692"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="745"/>
<source>Others</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="696"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="695"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="748"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="748"/>
<source>Text</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="726"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="725"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="778"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="778"/>
<source>Open Menu</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="734"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="733"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="786"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="786"/>
<source>Popup</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="744"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="743"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="796"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="796"/>
<source>Open Popup</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="749"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="748"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="801"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="801"/>
<source>Open Popup Dialog (Double Choices)</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="757"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="756"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="809"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="809"/>
<source>Open Popup Dialog (Triple Choices)</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="783"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="782"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="835"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="835"/>
<source>MessageBar</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="790"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="789"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="842"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="842"/>
<source>Generate One Message</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/components/TabBar.qml" line="797"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="796"/>
<location filename="../qml/Qt5/components/TabBar.qml" line="849"/>
<location filename="../qml/Qt6/components/TabBar.qml" line="849"/>
<source>Clear All Messages</source>
<translation></translation>
</message>
@ -409,178 +573,154 @@
<context>
<name>example</name>
<message>
<location filename="../qml/Qt5/example.qml" line="12"/>
<location filename="../qml/Qt6/example.qml" line="12"/>
<location filename="../qml/Qt5/example.qml" line="13"/>
<location filename="../qml/Qt6/example.qml" line="13"/>
<source>RibbonUI APP</source>
<translation>RibbonUI </translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="70"/>
<location filename="../qml/Qt6/example.qml" line="70"/>
<location filename="../qml/Qt5/example.qml" line="71"/>
<source>Tab Bar</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="71"/>
<location filename="../qml/Qt6/example.qml" line="71"/>
<location filename="../qml/Qt5/example.qml" line="72"/>
<source>A tab bar for window, let user choose the controllers.</source>
<translation>使</translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="79"/>
<location filename="../qml/Qt6/example.qml" line="79"/>
<location filename="../qml/Qt5/example.qml" line="80"/>
<source>Tab Bar Buttons</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="80"/>
<location filename="../qml/Qt6/example.qml" line="80"/>
<location filename="../qml/Qt5/example.qml" line="81"/>
<source>Tool buttons at the top of tab bar.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="84"/>
<location filename="../qml/Qt6/example.qml" line="84"/>
<location filename="../qml/Qt5/example.qml" line="85"/>
<source>Sliders</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="85"/>
<location filename="../qml/Qt6/example.qml" line="85"/>
<location filename="../qml/Qt5/example.qml" line="86"/>
<source>Vertical/Horizental sliders with/without buttons.</source>
<translation>//</translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="99"/>
<location filename="../qml/Qt6/example.qml" line="99"/>
<location filename="../qml/Qt5/example.qml" line="100"/>
<source>Switch Buttons</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="100"/>
<location filename="../qml/Qt6/example.qml" line="100"/>
<location filename="../qml/Qt5/example.qml" line="101"/>
<source>Switch buttons with/without background color or grabber text.</source>
<translation>/</translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="106"/>
<location filename="../qml/Qt6/example.qml" line="106"/>
<location filename="../qml/Qt5/example.qml" line="107"/>
<source>CheckBoxs</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="107"/>
<location filename="../qml/Qt6/example.qml" line="107"/>
<location filename="../qml/Qt5/example.qml" line="108"/>
<source>CheckBoxs with colorful background or with/without label text.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="111"/>
<location filename="../qml/Qt6/example.qml" line="111"/>
<location filename="../qml/Qt5/example.qml" line="112"/>
<source>Buttons</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="112"/>
<location filename="../qml/Qt6/example.qml" line="112"/>
<location filename="../qml/Qt5/example.qml" line="113"/>
<source>Buttons with/without background or label text.</source>
<translation>/</translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="118"/>
<location filename="../qml/Qt6/example.qml" line="118"/>
<location filename="../qml/Qt5/example.qml" line="119"/>
<source>Push Buttons</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="119"/>
<location filename="../qml/Qt6/example.qml" line="119"/>
<location filename="../qml/Qt5/example.qml" line="120"/>
<source>Push buttons with/without sub menu.</source>
<translation>/</translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="123"/>
<location filename="../qml/Qt6/example.qml" line="123"/>
<location filename="../qml/Qt5/example.qml" line="124"/>
<source>Line Edits</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="124"/>
<location filename="../qml/Qt6/example.qml" line="124"/>
<location filename="../qml/Qt5/example.qml" line="125"/>
<source>Line edits with/without icon.</source>
<translation>/</translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="138"/>
<location filename="../qml/Qt6/example.qml" line="138"/>
<location filename="../qml/Qt5/example.qml" line="139"/>
<source>Bottom Bar</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="139"/>
<location filename="../qml/Qt6/example.qml" line="139"/>
<location filename="../qml/Qt5/example.qml" line="140"/>
<source>A bottom bar for window.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="288"/>
<location filename="../qml/Qt5/example.qml" line="406"/>
<location filename="../qml/Qt6/example.qml" line="288"/>
<location filename="../qml/Qt6/example.qml" line="406"/>
<location filename="../qml/Qt5/example.qml" line="290"/>
<location filename="../qml/Qt5/example.qml" line="408"/>
<location filename="../qml/Qt6/example.qml" line="290"/>
<source>About</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="299"/>
<location filename="../qml/Qt6/example.qml" line="299"/>
<location filename="../qml/Qt5/example.qml" line="301"/>
<location filename="../qml/Qt6/example.qml" line="301"/>
<source>Tour</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="333"/>
<location filename="../qml/Qt6/example.qml" line="333"/>
<location filename="../qml/Qt5/example.qml" line="335"/>
<location filename="../qml/Qt6/example.qml" line="335"/>
<source>Test Item 2</source>
<translation> 1</translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="334"/>
<location filename="../qml/Qt6/example.qml" line="334"/>
<location filename="../qml/Qt5/example.qml" line="336"/>
<location filename="../qml/Qt6/example.qml" line="336"/>
<source>Test Item 3</source>
<translation> 1</translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="378"/>
<location filename="../qml/Qt5/example.qml" line="382"/>
<location filename="../qml/Qt6/example.qml" line="378"/>
<location filename="../qml/Qt5/example.qml" line="380"/>
<location filename="../qml/Qt5/example.qml" line="384"/>
<location filename="../qml/Qt6/example.qml" line="382"/>
<source>Home</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="385"/>
<location filename="../qml/Qt5/example.qml" line="389"/>
<location filename="../qml/Qt6/example.qml" line="385"/>
<location filename="../qml/Qt5/example.qml" line="387"/>
<location filename="../qml/Qt5/example.qml" line="391"/>
<location filename="../qml/Qt6/example.qml" line="389"/>
<source>File</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="392"/>
<location filename="../qml/Qt5/example.qml" line="396"/>
<location filename="../qml/Qt6/example.qml" line="392"/>
<location filename="../qml/Qt5/example.qml" line="394"/>
<location filename="../qml/Qt5/example.qml" line="398"/>
<location filename="../qml/Qt6/example.qml" line="396"/>
<source>Search</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="399"/>
<location filename="../qml/Qt6/example.qml" line="399"/>
<location filename="../qml/Qt5/example.qml" line="401"/>
<source>Account</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/example.qml" line="413"/>
<location filename="../qml/Qt6/example.qml" line="413"/>
<location filename="../qml/Qt5/example.qml" line="415"/>
<source>Settings</source>
<translation></translation>
</message>

View File

@ -0,0 +1,27 @@
#ifndef LOCALIZATION_H
#define LOCALIZATION_H
#include <QObject>
#include <QQmlEngine>
#include "ribbonlocalization.h"
class Localization : public RibbonLocalization
{
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
RIBBON_SINGLETON(Localization)
public:
virtual void loadCurrentLanguage() override;
virtual void saveCurrentLanguage(const QString &language)override;
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
public:
#else
private:
#endif
Localization() = default;
~Localization() = default;
};
#endif // LOCALIZATION_H

View File

@ -1,5 +1,6 @@
import QtQuick 2.15
import RibbonUI 1.1
import RibbonUIAPP 1.1
RibbonSplashScreen {
id: root
@ -12,6 +13,8 @@ RibbonSplashScreen {
"subTitleText": qsTr("A example for users to use RibbonUI.")
}
onContentArgsChanged: loadItemArgs()
Timer{
interval: 1000
triggeredOnStart: true
@ -23,4 +26,9 @@ RibbonSplashScreen {
root.showLoadingLog(qsTr("Loading...Remain %1s...").arg(remainSeconds), {})
}
}
Component.onCompleted: {
RibbonUI.autoLoadLanguage = true
RibbonUI.setTranslator(Localization)
}
}

View File

@ -3,6 +3,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.11
import QtQuick.Window 2.15
import RibbonUI 1.1
import RibbonUIAPP 1.1
import "components"
RibbonWindow {
@ -145,6 +146,7 @@ RibbonWindow {
}
Component.onCompleted: {
RibbonUI.autoLoadLanguage = true
RibbonUI.setTranslator(Localization)
tour.open()
}
@ -352,14 +354,12 @@ RibbonWindow {
Component{
id: t_content
RibbonBackStagePage{
property string rawName
pageName: qsTr(rawName)
onPageNameChanged: t_text.text = pageName
Rectangle{
anchors.fill: parent
color: "transparent"
RibbonText{
id: t_text
text: qsTr(pageName)
anchors.centerIn: parent
font.pixelSize: 20
}
@ -379,21 +379,21 @@ RibbonWindow {
menuIcon: RibbonIcons.Home
type: RibbonBackStageView.MenuItemLocation.Head
sourceComponent: t_content
sourceArgs:{'rawName':QT_TR_NOOP("Home")}
sourceArgs:{'pageName':QT_TR_NOOP("Home")}
}
RibbonBackStageMenuItem{
menuText: qsTr("File")
menuIcon: RibbonIcons.Document
type: RibbonBackStageView.MenuItemLocation.Head
sourceComponent: t_content
sourceArgs:{'rawName':QT_TR_NOOP("File")}
sourceArgs:{'pageName':QT_TR_NOOP("File")}
}
RibbonBackStageMenuItem{
menuText: qsTr("Search")
menuIcon: RibbonIcons.Search
type: RibbonBackStageView.MenuItemLocation.Body
sourceComponent: t_content
sourceArgs:{'rawName':QT_TR_NOOP("Search")}
sourceArgs:{'pageName':QT_TR_NOOP("Search")}
}
RibbonBackStageMenuItem{
menuText: qsTr("Account")

View File

@ -3,6 +3,7 @@ import QtQuick.Layouts 1.11
import QtQuick.Controls 2.15
import QtQuick.Window 2.15
import RibbonUI 1.1
import RibbonUIAPP 1.1
RibbonBackStagePage{
id: page
@ -118,23 +119,24 @@ RibbonBackStagePage{
textRole: "text"
iconSource: RibbonIcons.LocalLanguage
Component.onCompleted: update_state()
onActivated: RibbonLocalization.currentLanguage = model.get(currentIndex).value
onActivated: Localization.currentLanguage = model.get(currentIndex).value
Connections{
target: RibbonLocalization
target: Localization
function onCurrentLanguageChanged(){
lang_combo.update_state()
}
}
function update_state(){
model.clear()
let langs = RibbonLocalization.languageList()
let langs = Localization.languageList()
for(let i = 0; i < langs.length; i++){
model.append({
text:RibbonLocalization.languageTranslate(langs[i]),
text:Localization.languageTranslate(langs[i]),
value:langs[i]
})
}
currentIndex = find(RibbonLocalization.languageTranslate(RibbonLocalization.currentLanguage))
currentIndex = find(Localization.languageTranslate(Localization.currentLanguage))
}
}
}

View File

@ -1,5 +1,6 @@
import QtQuick
import RibbonUI
import RibbonUIAPP
RibbonSplashScreen {
id: root
@ -8,8 +9,8 @@ RibbonSplashScreen {
contentArgs: {
"implicitHeight": 250,
"implicitWidth": 450,
"titleText": qsTr("Example App"),
"subTitleText": qsTr("A example for users to use RibbonUI.")
"titleText": QT_TRANSLATE_NOOP("RibbonSplashScreen", "Example App"),
"subTitleText": QT_TRANSLATE_NOOP("RibbonSplashScreen", "A example for users to use RibbonUI.")
}
Timer{
@ -23,4 +24,9 @@ RibbonSplashScreen {
root.showLoadingLog(qsTr("Loading...Remain %1s...").arg(remainSeconds), {})
}
}
Component.onCompleted: {
RibbonUI.autoLoadLanguage = true
RibbonUI.setTranslator(Localization)
}
}

View File

@ -35,7 +35,7 @@ RibbonTabBar {
RibbonTabPage{
id: basic_page
title: qsTr("Basic")
title: QT_TRANSLATE_NOOP("RibbonTabBar", "Basic")
property var sliderLayout
property var sliderWithBtn
property var sliderWithoutBtn
@ -328,7 +328,7 @@ RibbonTabBar {
}
RibbonTabPage{
id: input_page
title: qsTr("Input")
title: QT_TRANSLATE_NOOP("RibbonTabBar", "Input")
property var lineEditLayout
property var lineEditWithIcon
@ -504,7 +504,7 @@ RibbonTabBar {
}
RibbonTabPage{
id: progress_page
title: qsTr("Progress")
title: QT_TRANSLATE_NOOP("RibbonTabBar", "Progress")
property var progressbarSlider
onContainerItemUpdated:{
if(getItem(0))
@ -666,7 +666,7 @@ RibbonTabBar {
}
}
RibbonTabPage{
title: qsTr("Indicator")
title: QT_TRANSLATE_NOOP("RibbonTabBar", "Indicator")
RibbonTabGroup{
text: qsTr("BusyRing")
width: busyring_layout.width + 30
@ -722,7 +722,7 @@ RibbonTabBar {
}
}
RibbonTabPage{
title: qsTr("Views")
title: QT_TRANSLATE_NOOP("RibbonTabBar", "Views")
RibbonTabGroup{
width: message_list_view_layout.width + 30
text: qsTr("MessageListView")
@ -742,7 +742,7 @@ RibbonTabBar {
}
}
RibbonTabPage{
title: qsTr("Others")
title: QT_TRANSLATE_NOOP("RibbonTabBar", "Others")
RibbonTabGroup{
width: text_layout.width + 30
text: qsTr("Text")

View File

@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Window
import RibbonUI
import RibbonUIAPP
import "components"
RibbonWindow {
@ -67,8 +68,8 @@ RibbonWindow {
RibbonTour{
id: tour
RibbonTourItem{
title: qsTr("Tab Bar")
text: qsTr("A tab bar for window, let user choose the controllers.")
title: QT_TRANSLATE_NOOP("RibbonTour", "Tab Bar")
text: QT_TRANSLATE_NOOP("RibbonTour", "A tab bar for window, let user choose the controllers.")
target: tab_bar
enterFunc: ()=>{
tab_bar.folded = false
@ -76,13 +77,13 @@ RibbonWindow {
}
}
RibbonTourItem{
title: qsTr("Tab Bar Buttons")
text: qsTr("Tool buttons at the top of tab bar.")
title: QT_TRANSLATE_NOOP("RibbonTour", "Tab Bar Buttons")
text: QT_TRANSLATE_NOOP("RibbonTour", "Tool buttons at the top of tab bar.")
target: tab_bar.tab_bar_tool
}
RibbonTourItem{
title: qsTr("Sliders")
text: qsTr("Vertical/Horizental sliders with/without buttons.")
title: QT_TRANSLATE_NOOP("RibbonTour", "Sliders")
text: QT_TRANSLATE_NOOP("RibbonTour", "Vertical/Horizental sliders with/without buttons.")
target: tab_bar.slider_layout
enterFunc: ()=>{
tab_bar.setPage(0)
@ -96,32 +97,32 @@ RibbonWindow {
}
}
RibbonTourItem{
title: qsTr("Switch Buttons")
text: qsTr("Switch buttons with/without background color or grabber text.")
title: QT_TRANSLATE_NOOP("RibbonTour", "Switch Buttons")
text: QT_TRANSLATE_NOOP("RibbonTour", "Switch buttons with/without background color or grabber text.")
target: tab_bar.switch_layout
enterFunc: ()=>tab_bar.btn_with_color_and_grabberText.checked = true
exitFunc: ()=>tab_bar.btn_with_color_and_grabberText.checked = false
}
RibbonTourItem{
title: qsTr("CheckBoxs")
text: qsTr("CheckBoxs with colorful background or with/without label text.")
title: QT_TRANSLATE_NOOP("RibbonTour", "CheckBoxs")
text: QT_TRANSLATE_NOOP("RibbonTour", "CheckBoxs with colorful background or with/without label text.")
target: tab_bar.checkbox_layout
}
RibbonTourItem{
title: qsTr("Buttons")
text: qsTr("Buttons with/without background or label text.")
title: QT_TRANSLATE_NOOP("RibbonTour", "Buttons")
text: QT_TRANSLATE_NOOP("RibbonTour", "Buttons with/without background or label text.")
target: tab_bar.button_layout
enterFunc: ()=>tab_bar.btn_without_bg_and_label.checked = true
exitFunc: ()=>tab_bar.btn_without_bg_and_label.checked = false
}
RibbonTourItem{
title: qsTr("Push Buttons")
text: qsTr("Push buttons with/without sub menu.")
title: QT_TRANSLATE_NOOP("RibbonTour", "Push Buttons")
text: QT_TRANSLATE_NOOP("RibbonTour", "Push buttons with/without sub menu.")
target: tab_bar.pushbutton_layout
}
RibbonTourItem{
title: qsTr("Line Edits")
text: qsTr("Line edits with/without icon.")
title: QT_TRANSLATE_NOOP("RibbonTour", "Line Edits")
text: QT_TRANSLATE_NOOP("RibbonTour", "Line edits with/without icon.")
target: tab_bar.lineedit_layout
enterFunc: ()=>{
tab_bar.setPage(1)
@ -135,8 +136,8 @@ RibbonWindow {
}
}
RibbonTourItem{
title: qsTr("Bottom Bar")
text: qsTr("A bottom bar for window.")
title: QT_TRANSLATE_NOOP("RibbonTour", "Bottom Bar")
text: QT_TRANSLATE_NOOP("RibbonTour", "A bottom bar for window.")
target: bottom_bar
}
target: windowItems
@ -145,6 +146,7 @@ RibbonWindow {
}
Component.onCompleted: {
RibbonUI.autoLoadLanguage = true
RibbonUI.setTranslator(Localization)
tour.open()
}
@ -352,14 +354,12 @@ RibbonWindow {
Component{
id: t_content
RibbonBackStagePage{
property string rawName
pageName: qsTr(rawName)
onPageNameChanged: t_text.text = pageName
Rectangle{
anchors.fill: parent
color: "transparent"
RibbonText{
id: t_text
text: qsTr(pageName)
anchors.centerIn: parent
font.pixelSize: 20
}
@ -375,42 +375,42 @@ RibbonWindow {
blurTarget: root.windowItems
radius: borderRadius
RibbonBackStageMenuItem{
menuText: qsTr("Home")
menuText: QT_TRANSLATE_NOOP("RibbonBackStageView","Home")
menuIcon: RibbonIcons.Home
type: RibbonBackStageView.MenuItemLocation.Head
sourceComponent: t_content
sourceArgs:{'rawName':QT_TR_NOOP("Home")}
sourceArgs:{'pageName':QT_TR_NOOP("Home")}
}
RibbonBackStageMenuItem{
menuText: qsTr("File")
menuText: QT_TRANSLATE_NOOP("RibbonBackStageView","File")
menuIcon: RibbonIcons.Document
type: RibbonBackStageView.MenuItemLocation.Head
sourceComponent: t_content
sourceArgs:{'rawName':QT_TR_NOOP("File")}
sourceArgs:{'pageName':QT_TR_NOOP("File")}
}
RibbonBackStageMenuItem{
menuText: qsTr("Search")
menuText: QT_TRANSLATE_NOOP("RibbonBackStageView","Search")
menuIcon: RibbonIcons.Search
type: RibbonBackStageView.MenuItemLocation.Body
sourceComponent: t_content
sourceArgs:{'rawName':QT_TR_NOOP("Search")}
sourceArgs:{'pageName':QT_TR_NOOP("Search")}
}
RibbonBackStageMenuItem{
menuText: qsTr("Account")
menuText: QT_TRANSLATE_NOOP("RibbonBackStageView","Account")
menuIcon: RibbonIcons.PersonAccounts
type: RibbonBackStageView.MenuItemLocation.Tail
clickOnly: true
clickFunc: ()=>console.log("Menu Account clicked")
}
RibbonBackStageMenuItem{
menuText: qsTr("About")
menuText: QT_TRANSLATE_NOOP("RibbonBackStageView","About")
menuIcon: RibbonIcons.Info
type: RibbonBackStageView.MenuItemLocation.Tail
clickOnly: true
clickFunc: ()=>root.showWindow(Qt.resolvedUrl("about.qml"))
}
RibbonBackStageMenuItem{
menuText: qsTr("Settings")
menuText: QT_TRANSLATE_NOOP("RibbonBackStageView","Settings")
menuIcon: RibbonIcons.Settings
type: RibbonBackStageView.MenuItemLocation.Tail
sourceUrl: Qt.resolvedUrl("pages/SettingsMenuPage.qml")

View File

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Window
import RibbonUI
import RibbonUIAPP
RibbonBackStagePage{
id: page
@ -118,23 +119,24 @@ RibbonBackStagePage{
textRole: "text"
iconSource: RibbonIcons.LocalLanguage
Component.onCompleted: update_state()
onActivated: RibbonLocalization.currentLanguage = model.get(currentIndex).value
onActivated: Localization.currentLanguage = model.get(currentIndex).value
Connections{
target: RibbonLocalization
target: Localization
function onCurrentLanguageChanged(){
lang_combo.update_state()
}
}
function update_state(){
model.clear()
let langs = RibbonLocalization.languageList()
let langs = Localization.languageList()
for(let i = 0; i < langs.length; i++){
model.append({
text:RibbonLocalization.languageTranslate(langs[i]),
text:Localization.languageTranslate(langs[i]),
value:langs[i]
})
}
currentIndex = find(RibbonLocalization.languageTranslate(RibbonLocalization.currentLanguage))
currentIndex = find(Localization.languageTranslate(Localization.currentLanguage))
}
}
}

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

View File

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 126 KiB

View File

@ -0,0 +1,11 @@
#include "localization.h"
#include "ribbonconfig.h"
void Localization::loadCurrentLanguage(){
QString language = RibbonConfig::getInstance()->get("Settings", "Current Language").toString();
setCurrentLanguage(language);
}
void Localization::saveCurrentLanguage(const QString &language){
RibbonConfig::getInstance()->set("Settings", "Current Language", language);
}

View File

@ -67,7 +67,10 @@ set (source_files
include/definitions.h
include/ribbontheme.h source/ribbontheme.cpp
include/platformsupport.h
include/ribbonlocalization.h source/ribbonlocalization.cpp)
include/ribbonlocalization.h source/ribbonlocalization.cpp
include/ribbonsingleton.h
include/ribbonconfig.h source/ribbonconfig.cpp
)
# Configure version header
set(__ribbonui_project_version "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
@ -171,5 +174,9 @@ target_include_directories(${PROJECT_NAME} PUBLIC
${PROJECT_BINARY_DIR}
)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(${PROJECT_NAME} PRIVATE QT_QML_DEBUG)
endif()
# Install QML plugin directory
install(DIRECTORY ${RIBBONUI_QML_PLUGIN_DIRECTORY} DESTINATION ${CMAKE_INSTALL_PREFIX}/imports)

View File

@ -28,26 +28,26 @@
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="482"/>
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="482"/>
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="488"/>
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="487"/>
<source>Close</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="493"/>
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="493"/>
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="499"/>
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="498"/>
<source>Minimize</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="504"/>
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="504"/>
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="510"/>
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="509"/>
<source>Restore</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="504"/>
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="504"/>
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="510"/>
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="509"/>
<source>Maximize</source>
<translation></translation>
</message>
@ -70,7 +70,7 @@
<context>
<name>RibbonLocalization</name>
<message>
<location filename="../source/ribbonlocalization.cpp" line="113"/>
<location filename="../source/ribbonlocalization.cpp" line="116"/>
<source>Not Found</source>
<translation></translation>
</message>
@ -176,8 +176,26 @@
<context>
<name>RibbonSplashScreenContent</name>
<message>
<location filename="../qml/Qt5/RibbonSplashScreenContent.qml" line="148"/>
<location filename="../qml/Qt6/RibbonSplashScreenContent.qml" line="148"/>
<location filename="../qml/Qt5/RibbonSplashScreenContent.qml" line="12"/>
<location filename="../qml/Qt6/RibbonSplashScreenContent.qml" line="12"/>
<source>Dylan Liu&apos;s Lab</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonSplashScreenContent.qml" line="13"/>
<location filename="../qml/Qt6/RibbonSplashScreenContent.qml" line="13"/>
<source>RibbonUI</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonSplashScreenContent.qml" line="14"/>
<location filename="../qml/Qt6/RibbonSplashScreenContent.qml" line="14"/>
<source>A lightweight UI framework.</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonSplashScreenContent.qml" line="15"/>
<location filename="../qml/Qt6/RibbonSplashScreenContent.qml" line="15"/>
<source>Loading...</source>
<translation></translation>
</message>
@ -228,13 +246,13 @@
<name>RibbonTabGroup</name>
<message>
<location filename="../qml/Qt5/RibbonTabGroup.qml" line="88"/>
<location filename="../qml/Qt6/RibbonTabGroup.qml" line="87"/>
<location filename="../qml/Qt6/RibbonTabGroup.qml" line="88"/>
<source>Open </source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonTabGroup.qml" line="88"/>
<location filename="../qml/Qt6/RibbonTabGroup.qml" line="87"/>
<location filename="../qml/Qt6/RibbonTabGroup.qml" line="88"/>
<source>&apos;s external</source>
<translation></translation>
</message>
@ -367,33 +385,33 @@
</context>
<context>
<name>RibbonWindow</name>
<message>
<location filename="../qml/Qt5/RibbonWindow.qml" line="148"/>
<location filename="../qml/Qt6/RibbonWindow.qml" line="148"/>
<source>Quit</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonWindow.qml" line="149"/>
<location filename="../qml/Qt6/RibbonWindow.qml" line="149"/>
<source>Minimize</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonWindow.qml" line="150"/>
<location filename="../qml/Qt6/RibbonWindow.qml" line="150"/>
<source>Quit</source>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonWindow.qml" line="151"/>
<location filename="../qml/Qt6/RibbonWindow.qml" line="151"/>
<source>Minimize</source>
<source>Do you want to close this window?</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonWindow.qml" line="152"/>
<location filename="../qml/Qt6/RibbonWindow.qml" line="152"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonWindow.qml" line="153"/>
<location filename="../qml/Qt6/RibbonWindow.qml" line="153"/>
<source>Do you want to close this window?</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonWindow.qml" line="154"/>
<location filename="../qml/Qt6/RibbonWindow.qml" line="154"/>
<source>Please note</source>
<translation></translation>
</message>
@ -401,22 +419,22 @@
<context>
<name>langList</name>
<message>
<location filename="../include/ribbonlocalization.h" line="43"/>
<location filename="../include/ribbonlocalization.h" line="44"/>
<source>zh_CN</source>
<translation>Chinese (Simplified)</translation>
</message>
<message>
<location filename="../include/ribbonlocalization.h" line="44"/>
<location filename="../include/ribbonlocalization.h" line="45"/>
<source>zh_TW</source>
<translation>Chinese (Traditional)</translation>
</message>
<message>
<location filename="../include/ribbonlocalization.h" line="45"/>
<location filename="../include/ribbonlocalization.h" line="46"/>
<source>en_US</source>
<translation>English (USA)</translation>
</message>
<message>
<location filename="../include/ribbonlocalization.h" line="46"/>
<location filename="../include/ribbonlocalization.h" line="47"/>
<source>en_UK</source>
<translation>English (UK)</translation>
</message>

View File

@ -28,26 +28,26 @@
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="482"/>
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="482"/>
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="488"/>
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="487"/>
<source>Close</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="493"/>
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="493"/>
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="499"/>
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="498"/>
<source>Minimize</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="504"/>
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="504"/>
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="510"/>
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="509"/>
<source>Restore</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="504"/>
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="504"/>
<location filename="../qml/Qt5/RibbonBackStageView.qml" line="510"/>
<location filename="../qml/Qt6/RibbonBackStageView.qml" line="509"/>
<source>Maximize</source>
<translation></translation>
</message>
@ -70,7 +70,7 @@
<context>
<name>RibbonLocalization</name>
<message>
<location filename="../source/ribbonlocalization.cpp" line="113"/>
<location filename="../source/ribbonlocalization.cpp" line="116"/>
<source>Not Found</source>
<translation></translation>
</message>
@ -176,8 +176,26 @@
<context>
<name>RibbonSplashScreenContent</name>
<message>
<location filename="../qml/Qt5/RibbonSplashScreenContent.qml" line="148"/>
<location filename="../qml/Qt6/RibbonSplashScreenContent.qml" line="148"/>
<location filename="../qml/Qt5/RibbonSplashScreenContent.qml" line="12"/>
<location filename="../qml/Qt6/RibbonSplashScreenContent.qml" line="12"/>
<source>Dylan Liu&apos;s Lab</source>
<translation>Dylan Liu&apos;s Lab</translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonSplashScreenContent.qml" line="13"/>
<location filename="../qml/Qt6/RibbonSplashScreenContent.qml" line="13"/>
<source>RibbonUI</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonSplashScreenContent.qml" line="14"/>
<location filename="../qml/Qt6/RibbonSplashScreenContent.qml" line="14"/>
<source>A lightweight UI framework.</source>
<translation>UI框架</translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonSplashScreenContent.qml" line="15"/>
<location filename="../qml/Qt6/RibbonSplashScreenContent.qml" line="15"/>
<source>Loading...</source>
<translation>...</translation>
</message>
@ -228,13 +246,13 @@
<name>RibbonTabGroup</name>
<message>
<location filename="../qml/Qt5/RibbonTabGroup.qml" line="88"/>
<location filename="../qml/Qt6/RibbonTabGroup.qml" line="87"/>
<location filename="../qml/Qt6/RibbonTabGroup.qml" line="88"/>
<source>Open </source>
<translation> </translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonTabGroup.qml" line="88"/>
<location filename="../qml/Qt6/RibbonTabGroup.qml" line="87"/>
<location filename="../qml/Qt6/RibbonTabGroup.qml" line="88"/>
<source>&apos;s external</source>
<translation></translation>
</message>
@ -369,32 +387,32 @@
<context>
<name>RibbonWindow</name>
<message>
<location filename="../qml/Qt5/RibbonWindow.qml" line="150"/>
<location filename="../qml/Qt6/RibbonWindow.qml" line="150"/>
<location filename="../qml/Qt5/RibbonWindow.qml" line="148"/>
<location filename="../qml/Qt6/RibbonWindow.qml" line="148"/>
<source>Quit</source>
<translation>退</translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonWindow.qml" line="151"/>
<location filename="../qml/Qt6/RibbonWindow.qml" line="151"/>
<location filename="../qml/Qt5/RibbonWindow.qml" line="149"/>
<location filename="../qml/Qt6/RibbonWindow.qml" line="149"/>
<source>Minimize</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonWindow.qml" line="152"/>
<location filename="../qml/Qt6/RibbonWindow.qml" line="152"/>
<location filename="../qml/Qt5/RibbonWindow.qml" line="150"/>
<location filename="../qml/Qt6/RibbonWindow.qml" line="150"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonWindow.qml" line="153"/>
<location filename="../qml/Qt6/RibbonWindow.qml" line="153"/>
<location filename="../qml/Qt5/RibbonWindow.qml" line="151"/>
<location filename="../qml/Qt6/RibbonWindow.qml" line="151"/>
<source>Do you want to close this window?</source>
<translation></translation>
</message>
<message>
<location filename="../qml/Qt5/RibbonWindow.qml" line="154"/>
<location filename="../qml/Qt6/RibbonWindow.qml" line="154"/>
<location filename="../qml/Qt5/RibbonWindow.qml" line="152"/>
<location filename="../qml/Qt6/RibbonWindow.qml" line="152"/>
<source>Please note</source>
<translation></translation>
</message>
@ -402,22 +420,22 @@
<context>
<name>langList</name>
<message>
<location filename="../include/ribbonlocalization.h" line="43"/>
<location filename="../include/ribbonlocalization.h" line="44"/>
<source>zh_CN</source>
<translation></translation>
</message>
<message>
<location filename="../include/ribbonlocalization.h" line="44"/>
<location filename="../include/ribbonlocalization.h" line="45"/>
<source>zh_TW</source>
<translation></translation>
</message>
<message>
<location filename="../include/ribbonlocalization.h" line="45"/>
<location filename="../include/ribbonlocalization.h" line="46"/>
<source>en_US</source>
<translation></translation>
</message>
<message>
<location filename="../include/ribbonlocalization.h" line="46"/>
<location filename="../include/ribbonlocalization.h" line="47"/>
<source>en_UK</source>
<translation></translation>
</message>

View File

@ -1,26 +1,17 @@
#ifndef PLATFORMSUPPORT_H
#define PLATFORMSUPPORT_H
#include <QQuickItem>
#include <QWindow>
#include <QMutex>
#include "ribbonsingleton.h"
class PlatformSupport : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
public:
static PlatformSupport* create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return instance();}
static PlatformSupport* instance(){
static QMutex mutex;
QMutexLocker locker(&mutex);
static PlatformSupport *singleton = nullptr;
if (!singleton) {
singleton = new PlatformSupport();
}
return singleton;
}
RIBBON_SINGLETON(PlatformSupport)
public:
#ifdef Q_OS_MACOS
Q_INVOKABLE void showSystemTitleBtns(QWindow *window, bool enable);
#endif
@ -28,9 +19,9 @@ public:
public:
#else
private:
Q_DISABLE_COPY_MOVE(PlatformSupport)
#endif
PlatformSupport(QObject *parent = nullptr) : QObject(parent){}
private:
bool bindEngine(){return bindEngineBegin();};
};
#endif // PLATFORMSUPPORT_H

View File

@ -0,0 +1,37 @@
#ifndef RIBBONCONFIG_H
#define RIBBONCONFIG_H
#include <QVariant>
#include <QSettings>
#include "definitions.h"
#include "ribbonsingleton.h"
class RIBBONUI_API RibbonConfig : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
RIBBON_SINGLETON(RibbonConfig)
public:
Q_INVOKABLE void set(QString qstrnodename,QString qstrkeyname,QVariant qvarvalue);
Q_INVOKABLE void setArray(QString qstrnodename,QString qstrkeyname,QVariant qvarvalue);
Q_INVOKABLE QVariant get(QString qstrnodename,QString qstrkeyname);
Q_INVOKABLE QVariant getArray(QString qstrnodename,QString qstrkeyname);
void clear();
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
public:
#else
private:
#endif
explicit RibbonConfig(QString qstrfilename = "");
~RibbonConfig() override;
protected:
virtual bool bindEngine(){return bindEngineBegin();};
QString qstrFileName;
QSettings *setting=nullptr;
QMutex mutex;
};
#endif // RIBBONCONFIG_H

View File

@ -1,41 +1,42 @@
#ifndef RIBBONLOCALIZATION_H
#define RIBBONLOCALIZATION_H
#include <QQuickItem>
#include <QLocale>
#include <QTranslator>
#include "ribbonsingleton.h"
#include "definitions.h"
class RibbonLocalization : public QQuickItem
class RIBBONUI_API RibbonLocalization : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
Q_PROPERTY(QString currentLanguage READ currentLanguage WRITE setCurrentLanguage NOTIFY currentLanguageChanged FINAL)
Q_PROPERTY_RW(bool, enabled);
RIBBON_SINGLETON(RibbonLocalization)
public:
typedef QPair<QString, QString> LangItem; // example: <"zh_CN", "qrc://i18n/xxx_zh_CN.qm">
typedef QMap<QString, QSharedPointer<QTranslator>> Translator; // example: <"main", mainTranslator>
typedef QMap<LangItem, QString> ModuleTranslator; // example: <zhItem, "main">
static RibbonLocalization* create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return instance();}
static RibbonLocalization* instance();
Q_INVOKABLE bool registerLanguage(QString langName, QString path, QString moduleName);
Q_INVOKABLE bool removeLanguage(QString langName, QString path);
Q_INVOKABLE void bindEngine();
Q_INVOKABLE QList<QString> languageList();
Q_INVOKABLE QString languageTranslate(QString langStr);
QString currentLanguage();
bool setCurrentLanguage(QString langName);
// Use if you need to directly save/load language from config files
Q_INVOKABLE virtual void loadCurrentLanguage(){};
virtual bool saveCurrentLanguage(const QString &language){return false;};
virtual void loadCurrentLanguage(){};
virtual void saveCurrentLanguage(const QString &language){};
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
public:
#else
private:
Q_DISABLE_COPY_MOVE(RibbonLocalization)
protected:
#endif
RibbonLocalization();
~RibbonLocalization();
virtual ~RibbonLocalization() override;
protected:
virtual bool bindEngine();
virtual void switchState();
ModuleTranslator moduleLangList;
Translator transList;
QString _currentLang;
@ -47,6 +48,6 @@ protected:
};
signals:
void currentLanguageChanged();
void registerLanguageFinished();
};
#endif // RIBBONLOCALIZATION_H

View File

@ -0,0 +1,92 @@
#ifndef RIBBONSINGLETON_H
#define RIBBONSINGLETON_H
#include <QObject>
#include <QQmlApplicationEngine>
#include <QMutex>
#include <QTimer>
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
#include "ribbonui_version.h"
#endif
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
#define RIBBON_SINGLETON(X) \
public: \
static X* create (QQmlEngine *qmlEngine, QJSEngine *jsEngine){return getInstance();} \
static X* getInstance(){ \
static QMutex mutex; \
QMutexLocker locker(&mutex); \
static X *singleton = nullptr; \
if (!singleton || needRefresh) { \
needRefresh() = false; \
if(getTypeId() == -1 || !getEngine()) \
singleton = new X(); \
else \
singleton = getEngine()->singletonInstance<X *>(getTypeId()); \
} \
return singleton; \
}; \
static void destroy(){ \
needRefresh() = true; \
X::getInstance()->~X(); \
}; \
protected: \
static int getTypeId(){ \
static int typeId = -1; \
if(typeId == -1){ \
QString version(RIBBONUI_VERSION); \
QStringList versionList = version.split('.'); \
typeId = qmlTypeId("RibbonUI", versionList[0].toInt(), \
versionList[1].toInt(), staticMetaObject.className()); \
} \
return typeId; \
}; \
static QQmlApplicationEngine*& getEngine(){ \
static QQmlApplicationEngine* engine = nullptr; \
return engine; \
} \
static bool& needRefresh(){ \
static bool need = false; \
return need; \
} \
bool bindEngineBegin(){ \
QQmlApplicationEngine* &engine = getEngine(); \
engine = dynamic_cast<QQmlApplicationEngine*>(qmlEngine(this)); \
if (!engine){ \
dynamic_cast<X*>(this)->~X(); \
return false; \
} \
return true; \
}; \
void initialBind(){ \
QTimer::singleShot(1, this, &X::bindEngine); \
};
#else
#define RIBBON_SINGLETON(X) \
public: \
static X* create (QQmlEngine *qmlEngine, QJSEngine *jsEngine){return getInstance();} \
static X* getInstance(){ \
static QMutex mutex; \
QMutexLocker locker(&mutex); \
static X *singleton = nullptr; \
if (!singleton) { \
singleton = new X(); \
} \
return singleton; \
}; \
static void destroy(){ \
X::getInstance()->~X(); \
}; \
protected: \
bool bindEngineBegin(){ \
QQmlApplicationEngine *engine = dynamic_cast<QQmlApplicationEngine*>(qmlEngine(this)); \
if (!engine){ \
return false; \
} \
return true; \
}; \
void initialBind(){QTimer::singleShot(1000, this, &X::bindEngine);}; \
private: \
Q_DISABLE_COPY_MOVE(X)
#endif
#endif // RIBBONSINGLETON_H

View File

@ -1,10 +1,10 @@
#ifndef RIBBONTHEME_H
#define RIBBONTHEME_H
#include <QQuickItem>
#include "ribbonsingleton.h"
#include "definitions.h"
class RibbonTheme : public QQuickItem
class RibbonTheme : public QObject
{
Q_OBJECT
QML_ELEMENT
@ -14,21 +14,21 @@ class RibbonTheme : public QQuickItem
Q_PROPERTY_RW(RibbonThemeType::ThemeMode,themeMode)
Q_PROPERTY_RW(bool,modernStyle)
Q_PROPERTY_RW(bool,nativeText)
RIBBON_SINGLETON(RibbonTheme)
public:
static RibbonTheme* create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return instance();}
static RibbonTheme* instance();
Q_SIGNAL void isDarkModeChanged();
bool isDarkMode();
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
public:
#else
private:
Q_DISABLE_COPY_MOVE(RibbonTheme)
#endif
RibbonTheme();
private:
bool eventFilter(QObject *obj, QEvent *event);
bool bindEngine(){return bindEngineBegin();};
RibbonThemeType::ThemeMode currentTheme();
RibbonThemeType::ThemeMode _system_themeMode;
};
#endif // RIBBONTHEME_H

View File

@ -1,11 +1,11 @@
#ifndef RIBBONUI_H
#define RIBBONUI_H
#include <QQuickItem>
#include "ribbonsingleton.h"
#include "definitions.h"
#include "ribbonlocalization.h"
class RibbonUI : public QQuickItem
class RibbonUI : public QObject
{
Q_OBJECT
QML_ELEMENT
@ -16,12 +16,12 @@ class RibbonUI : public QQuickItem
Q_PROPERTY_R(int, isWin11)
Q_PROPERTY_RW(QVariantMap, windowsSet)
Q_PROPERTY(bool autoLoadLanguage READ autoLoadLanguage WRITE setAutoLoadLanguage NOTIFY autoLoadLanguageChanged FINAL)
RIBBON_SINGLETON(RibbonUI)
public:
static RibbonUI* instance();
static RibbonUI* create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return instance();}
RIBBONUI_API static void init();
RIBBONUI_API static void registerTypes(const char *uri);
RIBBONUI_API Q_INVOKABLE void setTranslator(RibbonLocalization *translator = RibbonLocalization::instance());
RIBBONUI_API Q_INVOKABLE void setTranslator(RibbonLocalization *translator = RibbonLocalization::getInstance());
Q_INVOKABLE void initTranslator();
bool autoLoadLanguage(){return _autoLoadLanguage;};
void setAutoLoadLanguage(bool value);
@ -31,15 +31,16 @@ public:
public:
#else
private:
Q_DISABLE_COPY_MOVE(RibbonUI)
#endif
explicit RibbonUI(QQuickItem *parent = nullptr);
explicit RibbonUI(QObject *parent = nullptr);
private:
RibbonLocalization* _translator;
bool bindEngine(){return bindEngineBegin();};
RibbonLocalization* _translator = nullptr;
bool _autoLoadLanguage = false;
signals:
void autoLoadLanguageChanged();
void initTranslatorFinished();
};
#endif // RIBBONUI_H

View File

@ -251,7 +251,7 @@ Popup {
}
Text{
id: menu_label
text: model.menuText
text: qsTranslate("RibbonBackStageView",model.menuText)
color: !mouse.containsMouse && RibbonTheme.modernStyle && item_bg.view.currentIndex === index && item_bg.isCurrentMenu ? RibbonTheme.isDarkMode ? "#779CDB" : "#5882BB" : back_btn.textColor
Layout.alignment: Qt.AlignVCenter
verticalAlignment: Text.AlignVCenter

View File

@ -31,15 +31,17 @@ Window {
source: contentSource ? contentSource : ""
onLoaded: {
root.showLoadingLog.connect(item.dealWithLog)
if (!Object.keys(container.args).length)
return
else if(Object.keys(container.args).length){
for (let arg in container.args){
item[arg] = container.args[arg]
}
}
else{
console.error("RibbonSplashScreen: Arguments error, please check.")
item.onDestroyed.connect(function(){
root.showLoadingLog.disconnect(item.dealWithLog)
})
loadItemArgs()
}
onStatusChanged: {
if(status === Loader.Null &&
((contentSource !== source) ||
(contentItems !== sourceComponent))){
sourceComponent = contentSource ? undefined : contentItems
source = contentSource ? contentSource : ""
}
}
}
@ -142,4 +144,19 @@ Window {
internal.isComponentReady = true
}
}
function loadItemArgs(){
if(loader.item){
if (!Object.keys(container.args).length)
return
else if(Object.keys(container.args).length){
for (let arg in container.args){
loader.item[arg] = container.args[arg]
}
}
else{
console.error("RibbonSplashScreen: Arguments error, please check.")
}
}
}
}

View File

@ -9,9 +9,12 @@ Rectangle {
property var dealWithLog: showLog
property string picSource: "qrc:/qt/qml/RibbonUI/resources/imgs/icon.png"
property string labelText: "Dylan Liu's Lab"
property string titleText: "RibbonUI"
property string subTitleText: "A lightweight UI framework."
property var labelText: QT_TR_NOOP("Dylan Liu's Lab")
property var titleText: QT_TR_NOOP("RibbonUI")
property var subTitleText: QT_TR_NOOP("A lightweight UI framework.")
property var logText: QT_TR_NOOP("Loading...")
signal onDestroyed()
color: {
if (Window.window.blurBehindWindow) {
@ -88,7 +91,7 @@ Rectangle {
}
Text {
id: label_text
text: control.labelText
text: qsTranslate("RibbonSplashScreen", control.labelText)
Layout.alignment: Qt.AlignVCenter
font.family: Qt.platform.os === "osx" ? "PingFang SC" : "Microsoft YaHei UI"
font.pixelSize: 16
@ -109,7 +112,7 @@ Rectangle {
spacing: -5
Text {
id: title_text
text: control.titleText
text: qsTranslate("RibbonSplashScreen", control.titleText)
Layout.alignment: Qt.AlignHCenter
font.family: Qt.platform.os === "osx" ? "PingFang SC" : "Microsoft YaHei UI"
font.pixelSize: 50
@ -126,7 +129,7 @@ Rectangle {
}
Text {
id: subtitle_text
text: control.subTitleText
text: qsTranslate("RibbonSplashScreen", control.subTitleText)
Layout.alignment: Qt.AlignHCenter
font.family: Qt.platform.os === "osx" ? "PingFang SC" : "Microsoft YaHei UI"
font.pixelSize: 15
@ -156,7 +159,7 @@ Rectangle {
bottom: parent.bottom
bottomMargin: btn_layout.anchors.topMargin
}
text: qsTr("Loading...")
text: qsTranslate("RibbonSplashScreen", control.logText)
font.family: Qt.platform.os === "osx" ? "PingFang SC" : "Microsoft YaHei UI"
font.pixelSize: 10
color: RibbonTheme.modernStyle ? RibbonTheme.isDarkMode ? "white" : "black" : "white"
@ -170,7 +173,9 @@ Rectangle {
}
}
Component.onDestruction: onDestroyed()
function showLog(log, others){
log_text.text = log
control.logText = log
}
}

View File

@ -225,7 +225,7 @@ Item{
{
let item = stack.contentData[i]
if(item instanceof RibbonTabPage){
let btn = ribbonTabButton.createObject(bar,{text:item.title,index:sign})
let btn = ribbonTabButton.createObject(bar,{text:qsTranslate("RibbonTabBar", item.title),index:sign})
item.titleChanged.connect(function(){btn.text=item.title})
if (sign===0)
{

View File

@ -16,7 +16,7 @@ Item {
RibbonText{
Layout.preferredWidth: parent.width - leftPadding - rightPadding
font.pixelSize: 22
text: popup.targetList[popup.currentIndex].title
text: qsTranslate("RibbonTour", popup.targetList[popup.currentIndex].title)
viewOnly: true
topPadding: contentMargins * 3 / 4
leftPadding: contentMargins
@ -32,7 +32,7 @@ Item {
font.pixelSize: 13
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
verticalAlignment: Text.AlignVCenter
text: popup.targetList[popup.currentIndex].text
text: qsTranslate("RibbonTour", popup.targetList[popup.currentIndex].text)
viewOnly: true
topPadding: contentMargins * 3 / 4
leftPadding: contentMargins

View File

@ -70,9 +70,7 @@ Window {
{
windowAgent.setWindowAttribute("blur-effect", blurBehindWindow ? RibbonTheme.isDarkMode ? "dark" : "light" : "none")
}
RibbonLocalization.bindEngine();
RibbonUI.setTranslator(RibbonLocalization)
window.visible = true
windowAgent.centralize()
raise()

View File

@ -251,7 +251,7 @@ Popup {
}
Text{
id: menu_label
text: model.menuText
text: qsTranslate("RibbonBackStageView",model.menuText)
color: !mouse.containsMouse && RibbonTheme.modernStyle && item_bg.view.currentIndex === index && item_bg.isCurrentMenu ? RibbonTheme.isDarkMode ? "#779CDB" : "#5882BB" : back_btn.textColor
Layout.alignment: Qt.AlignVCenter
verticalAlignment: Text.AlignVCenter
@ -443,6 +443,7 @@ Popup {
model: control.pageModel
Loader {
required property var modelData
asynchronous: true
active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem
source: typeof(modelData.sourceUrl) !== 'undefined' && modelData.sourceUrl !== ""? modelData.sourceUrl : ""
sourceComponent: typeof(control.pageModel[modelData.globalIndex].sourceComponent) !== 'undefined' && typeof(modelData.sourceUrl) === 'undefined' ? control.pageModel[modelData.globalIndex].sourceComponent : undefined

View File

@ -31,15 +31,17 @@ Window {
source: contentSource ? contentSource : ""
onLoaded: {
root.showLoadingLog.connect(item.dealWithLog)
if (!Object.keys(container.args).length)
return
else if(Object.keys(container.args).length){
for (let arg in container.args){
item[arg] = container.args[arg]
}
}
else{
console.error("RibbonSplashScreen: Arguments error, please check.")
item.onDestroyed.connect(function(){
root.showLoadingLog.disconnect(item.dealWithLog)
})
loadItemArgs()
}
onStatusChanged: {
if(status === Loader.Null &&
((contentSource !== source) ||
(contentItems !== sourceComponent))){
sourceComponent = contentSource ? undefined : contentItems
source = contentSource ? contentSource : ""
}
}
}
@ -142,4 +144,19 @@ Window {
internal.isComponentReady = true
}
}
function loadItemArgs(){
if(loader.item){
if (!Object.keys(container.args).length)
return
else if(Object.keys(container.args).length){
for (let arg in container.args){
loader.item[arg] = container.args[arg]
}
}
else{
console.error("RibbonSplashScreen: Arguments error, please check.")
}
}
}
}

View File

@ -9,9 +9,12 @@ Rectangle {
property var dealWithLog: showLog
property string picSource: "qrc:/qt/qml/RibbonUI/resources/imgs/icon.png"
property string labelText: "Dylan Liu's Lab"
property string titleText: "RibbonUI"
property string subTitleText: "A lightweight UI framework."
property var labelText: QT_TR_NOOP("Dylan Liu's Lab")
property var titleText: QT_TR_NOOP("RibbonUI")
property var subTitleText: QT_TR_NOOP("A lightweight UI framework.")
property var logText: QT_TR_NOOP("Loading...")
signal onDestroyed()
color: {
if (Window.window.blurBehindWindow) {
@ -88,7 +91,7 @@ Rectangle {
}
Text {
id: label_text
text: control.labelText
text: qsTranslate("RibbonSplashScreen", control.labelText)
Layout.alignment: Qt.AlignVCenter
font.family: Qt.platform.os === "osx" ? "PingFang SC" : "Microsoft YaHei UI"
font.pixelSize: 16
@ -109,7 +112,7 @@ Rectangle {
spacing: -5
Text {
id: title_text
text: control.titleText
text: qsTranslate("RibbonSplashScreen", control.titleText)
Layout.alignment: Qt.AlignHCenter
font.family: Qt.platform.os === "osx" ? "PingFang SC" : "Microsoft YaHei UI"
font.pixelSize: 50
@ -126,7 +129,7 @@ Rectangle {
}
Text {
id: subtitle_text
text: control.subTitleText
text: qsTranslate("RibbonSplashScreen", control.subTitleText)
Layout.alignment: Qt.AlignHCenter
font.family: Qt.platform.os === "osx" ? "PingFang SC" : "Microsoft YaHei UI"
font.pixelSize: 15
@ -156,7 +159,7 @@ Rectangle {
bottom: parent.bottom
bottomMargin: btn_layout.anchors.topMargin
}
text: qsTr("Loading...")
text: qsTranslate("RibbonSplashScreen", control.logText)
font.family: Qt.platform.os === "osx" ? "PingFang SC" : "Microsoft YaHei UI"
font.pixelSize: 10
color: RibbonTheme.modernStyle ? RibbonTheme.isDarkMode ? "white" : "black" : "white"
@ -170,7 +173,9 @@ Rectangle {
}
}
Component.onDestruction: onDestroyed()
function showLog(log, others){
log_text.text = log
control.logText = log
}
}

View File

@ -225,7 +225,7 @@ Item{
{
let item = stack.contentData[i]
if(item instanceof RibbonTabPage){
let btn = ribbonTabButton.createObject(bar,{text:item.title,index:sign})
let btn = ribbonTabButton.createObject(bar,{text:qsTranslate("RibbonTabBar", item.title),index:sign})
item.titleChanged.connect(function(){btn.text=item.title})
if (sign===0)
{

View File

@ -17,7 +17,7 @@ Item {
RibbonText{
Layout.preferredWidth: parent.width - leftPadding - rightPadding
font.pixelSize: 22
text: popup.targetList[popup.currentIndex].title
text: qsTranslate("RibbonTour", popup.targetList[popup.currentIndex].title)
viewOnly: true
topPadding: contentMargins * 3 / 4
leftPadding: contentMargins
@ -33,7 +33,7 @@ Item {
font.pixelSize: 13
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
verticalAlignment: Text.AlignVCenter
text: popup.targetList[popup.currentIndex].text
text: qsTranslate("RibbonTour", popup.targetList[popup.currentIndex].text)
viewOnly: true
topPadding: contentMargins * 3 / 4
leftPadding: contentMargins

View File

@ -70,9 +70,7 @@ Window {
{
windowAgent.setWindowAttribute("blur-effect", blurBehindWindow ? RibbonTheme.isDarkMode ? "dark" : "light" : "none")
}
RibbonLocalization.bindEngine();
RibbonUI.setTranslator(RibbonLocalization)
window.visible = true
windowAgent.centralize()
raise()

View File

@ -0,0 +1,71 @@
#include "ribbonconfig.h"
#include <QCoreApplication>
#include <QDebug>
RibbonConfig::RibbonConfig(QString qstrfilename):
QObject(nullptr)
{
if (qstrfilename.isEmpty())
{
qstrFileName = QCoreApplication::applicationDirPath() + "/config.ini";
}
else
{
qstrFileName = qstrfilename;
}
setting = new QSettings(qstrFileName, QSettings::IniFormat);
initialBind();
}
RibbonConfig::~RibbonConfig()
{
delete setting;
setting = nullptr;
}
void RibbonConfig::set(QString qstrnodename,QString qstrkeyname,QVariant qvarvalue)
{
QMutexLocker locker(&mutex);
setting->setValue(QString("/%1/%2").arg(qstrnodename, qstrkeyname), qvarvalue);
}
void RibbonConfig::setArray(QString qstrnodename,QString qstrkeyname,QVariant qvarvalue)
{
QMutexLocker locker(&mutex);
setting->beginWriteArray(QString("/%1/%2").arg(qstrnodename, qstrkeyname));
QList<QVariant> list = qvarvalue.toList();
for (int i = 0; i< list.length(); i++)
{
setting->setArrayIndex(i);
setting->setValue(qstrkeyname, list.at(i));
}
setting->endArray();
}
QVariant RibbonConfig::get(QString qstrnodename,QString qstrkeyname)
{
QMutexLocker locker(&mutex);
QVariant qvar = setting->value(QString("/%1/%2").arg(qstrnodename, qstrkeyname));
return qvar;
}
QVariant RibbonConfig::getArray(QString qstrnodename,QString qstrkeyname)
{
QMutexLocker locker(&mutex);
QList<QVariant> list;
int size = setting->beginReadArray(QString("/%1/%2").arg(qstrnodename, qstrkeyname));
for (int i = 0; i< size; i++)
{
setting->setArrayIndex(i);
list.append(setting->value(qstrkeyname));
}
setting->endArray();
return list;
}
void RibbonConfig::clear()
{
QMutexLocker locker(&mutex);
setting->clear();
}

View File

@ -1,28 +1,20 @@
#include "ribbonlocalization.h"
#include <QMutex>
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QTimer>
RibbonLocalization::RibbonLocalization() {
RibbonLocalization::RibbonLocalization(){
_currentLang = "en_US";
_enabled = true;
initialBind();
connect(this, &RibbonLocalization::enabledChanged, this, &RibbonLocalization::switchState);
}
RibbonLocalization::~RibbonLocalization() {
for (auto item : transList)
for (auto item : std::as_const(transList))
item.clear();
}
RibbonLocalization* RibbonLocalization::instance(){
static QMutex mutex;
QMutexLocker locker(&mutex);
static RibbonLocalization *singleton = nullptr;
if (!singleton) {
singleton = new RibbonLocalization();
}
return singleton;
}
bool RibbonLocalization::registerLanguage(QString langName, QString path, QString moduleName){
LangItem temp(langName, path);
if(!moduleLangList.contains(temp)){
@ -34,8 +26,10 @@ bool RibbonLocalization::registerLanguage(QString langName, QString path, QStrin
}
}
moduleLangList.insert(temp, moduleName);
emit registerLanguageFinished();
return true;
}
emit registerLanguageFinished();
return false;
}
@ -62,12 +56,13 @@ QString RibbonLocalization::currentLanguage(){
bool RibbonLocalization::setCurrentLanguage(QString langName){
bool hasChanged = false;
QMap<QString, bool> isNeeded;
for(auto langItem : moduleLangList.keys()){
auto keys = moduleLangList.keys();
for(auto &langItem : keys){
if(langItem.first == langName){
isNeeded[moduleLangList[langItem]] = true;
Q_UNUSED(transList[moduleLangList[langItem]].get()->load(langItem.second));
_currentLang = langName;
qApp->installTranslator(transList[moduleLangList[langItem]].get());;
qApp->installTranslator(transList[moduleLangList[langItem]].get());
hasChanged = true;
}
else{
@ -83,23 +78,31 @@ bool RibbonLocalization::setCurrentLanguage(QString langName){
return hasChanged;
}
void RibbonLocalization::bindEngine(){
QQmlApplicationEngine * engine = dynamic_cast<QQmlApplicationEngine*>(qmlEngine(this));
Q_ASSERT(engine);
if (!engine)
return;
QObject::connect(this, &RibbonLocalization::currentLanguageChanged, engine, [engine]() -> void {
engine->retranslate();
});
bool RibbonLocalization::bindEngine(){
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
QQmlApplicationEngine* &engine = getEngine();
engine = dynamic_cast<QQmlApplicationEngine*>(qmlEngine(this));
#else
QQmlApplicationEngine *engine = dynamic_cast<QQmlApplicationEngine*>(qmlEngine(this));
#endif
if(bindEngineBegin()){
QObject::connect(this, &RibbonLocalization::currentLanguageChanged, engine, [engine]() -> void {
engine->retranslate();
});
loadCurrentLanguage();
return true;
}
return false;
}
QList<QString> RibbonLocalization::languageList(){
QList<QString> list;
QSet<QString> set;
for(auto langItem : moduleLangList.keys()){
auto keys = moduleLangList.keys();
for(auto &langItem : keys){
set.insert(langItem.first);
}
for(auto setItem : set){
for(auto &setItem : set){
list.append(setItem);
}
return list;
@ -112,3 +115,17 @@ QString RibbonLocalization::languageTranslate(QString langStr){
else
return tr("Not Found");
}
void RibbonLocalization::switchState(){
if(_enabled){
setCurrentLanguage(_currentLang);
}
else{
auto keys = moduleLangList.keys();
for(auto &langItem : keys){
if(langItem.first == _currentLang){
qApp->removeTranslator(transList[moduleLangList[langItem]].get());
}
}
}
}

View File

@ -21,17 +21,7 @@ RibbonTheme::RibbonTheme()
modernStyle(false);
nativeText(true);
qApp->installEventFilter(this);
}
RibbonTheme* RibbonTheme::instance(){
static QMutex mutex;
QMutexLocker locker(&mutex);
static RibbonTheme *singleton = nullptr;
if (!singleton) {
singleton = new RibbonTheme();
}
return singleton;
initialBind();
}
bool RibbonTheme::eventFilter(QObject *obj, QEvent *event)

View File

@ -7,24 +7,14 @@
#include <QDir>
#include "ribbonui_version.h"
RibbonUI::RibbonUI(QQuickItem *parent)
: QQuickItem(parent)
RibbonUI::RibbonUI(QObject *parent)
: QObject(parent)
{
_version = RIBBONUI_VERSION;
_qtVersion = QString(qVersion()).replace('.',"").toInt();
_isWin11 = QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10, 0, 22000);
_translator = RibbonLocalization::instance();
}
RibbonUI* RibbonUI::instance(){
static QMutex mutex;
QMutexLocker locker(&mutex);
static RibbonUI *singleton = nullptr;
if (!singleton) {
singleton = new RibbonUI();
}
return singleton;
_translator = RibbonLocalization::getInstance();
initialBind();
}
void RibbonUI::init()
@ -49,7 +39,9 @@ void RibbonUI::registerTypes(const char *uri)
}
void RibbonUI::setTranslator(RibbonLocalization *translator){
_translator->enabled(false);
_translator = translator;
_translator->enabled(true);
initTranslator();
}
@ -59,7 +51,7 @@ void RibbonUI::initTranslator(){
filters<<"*.qm";
dir.setNameFilters(filters);
QStringList matchedFiles = dir.entryList();
for(auto file : matchedFiles){
for(auto &file : std::as_const(matchedFiles)){
QString project, lang;
int start = 0;
int end = file.indexOf('_');
@ -79,6 +71,7 @@ void RibbonUI::initTranslator(){
}
}
}
emit initTranslatorFinished();
}
void RibbonUI::setAutoLoadLanguage(bool value){