├── .vscode ├── c_cpp_properties.json ├── launch.json └── settings.json ├── HelperWindow.pro ├── HelperWindow.pro.user ├── README.md ├── framelesshelper ├── .github │ └── workflows │ │ └── ci.yml ├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── FramelessHelperConfig.cmake.in ├── LICENSE ├── README.md ├── build.bat ├── cmake │ ├── .gitignore │ ├── LICENSE │ ├── LLVM-Install.bat │ ├── README.md │ ├── VC-LTL.cmake │ ├── YY-Thunks-Install.bat │ ├── YY-Thunks.cmake │ ├── setup-proxy.bat │ ├── setup-proxy.ps1 │ └── utils.cmake ├── examples │ ├── CMakeLists.txt │ ├── dialog │ │ ├── CMakeLists.txt │ │ ├── dialog.cpp │ │ ├── dialog.h │ │ └── main.cpp │ ├── mainwindow │ │ ├── CMakeLists.txt │ │ ├── main.cpp │ │ ├── mainwindow.cpp │ │ ├── mainwindow.h │ │ └── mainwindow.ui │ ├── openglwidget │ │ ├── CMakeLists.txt │ │ ├── glwidget.cpp │ │ ├── glwidget.h │ │ ├── images.qrc │ │ ├── images │ │ │ └── qtlogo.png │ │ ├── logo.cpp │ │ ├── logo.h │ │ ├── main.cpp │ │ ├── mainwindow.cpp │ │ └── mainwindow.h │ ├── quick │ │ ├── CMakeLists.txt │ │ ├── images │ │ │ ├── microsoft.png │ │ │ └── microsoft.svg │ │ ├── main.cpp │ │ ├── qml │ │ │ ├── ApplicationWindow.qml │ │ │ ├── HomePage.qml │ │ │ └── Window.qml │ │ ├── quick.pro │ │ ├── quicksettings.cpp │ │ ├── quicksettings.h │ │ ├── resources.qrc │ │ └── scripts │ │ │ ├── d3d11.bat │ │ │ ├── d3d12.bat │ │ │ ├── opengl.bat │ │ │ └── vulkan.bat │ ├── shared │ │ ├── example.ico │ │ ├── log.cpp │ │ ├── log.h │ │ ├── settings.cpp │ │ └── settings.h │ └── widget │ │ ├── CMakeLists.txt │ │ ├── main.cpp │ │ ├── widget.cpp │ │ ├── widget.h │ │ └── widget.pro ├── include │ └── FramelessHelper │ │ ├── Core │ │ ├── ChromePalette │ │ ├── FramelessHelper_Linux │ │ ├── FramelessHelper_Qt │ │ ├── FramelessHelper_Win │ │ ├── FramelessHelper_Windows │ │ ├── FramelessManager │ │ ├── Global │ │ ├── MicaMaterial │ │ ├── Utils │ │ ├── WindowBorderPainter │ │ ├── chromepalette.h │ │ ├── framelesshelper_linux.h │ │ ├── framelesshelper_qt.h │ │ ├── framelesshelper_win.h │ │ ├── framelesshelper_windows.h │ │ ├── framelesshelpercore_global.h │ │ ├── framelessmanager.h │ │ ├── micamaterial.h │ │ ├── private │ │ │ ├── chromepalette_p.h │ │ │ ├── framelessconfig_p.h │ │ │ ├── framelesshelpercore_global_p.h │ │ │ ├── framelessmanager_p.h │ │ │ ├── micamaterial_p.h │ │ │ ├── registrykey_p.h │ │ │ ├── scopeguard_p.h │ │ │ ├── sysapiloader_p.h │ │ │ ├── versionnumber_p.h │ │ │ ├── windowborderpainter_p.h │ │ │ └── winverhelper_p.h │ │ ├── utils.h │ │ └── windowborderpainter.h │ │ ├── Quick │ │ ├── FramelessQuickHelper │ │ ├── FramelessQuickModule │ │ ├── FramelessQuickUtils │ │ ├── Global │ │ ├── QuickChromePalette │ │ ├── QuickMicaMaterial │ │ ├── QuickWindowBorder │ │ ├── framelesshelperquick_global.h │ │ ├── framelessquickhelper.h │ │ ├── framelessquickmodule.h │ │ ├── framelessquickutils.h │ │ ├── private │ │ │ ├── framelessquickapplicationwindow_p.h │ │ │ ├── framelessquickapplicationwindow_p_p.h │ │ │ ├── framelessquickhelper_p.h │ │ │ ├── framelessquickwindow_p.h │ │ │ ├── framelessquickwindow_p_p.h │ │ │ ├── quickimageitem_p.h │ │ │ ├── quickmicamaterial_p.h │ │ │ ├── quickstandardsystembutton_p.h │ │ │ ├── quickstandardtitlebar_p.h │ │ │ └── quickwindowborder_p.h │ │ ├── quickchromepalette.h │ │ ├── quickmicamaterial.h │ │ └── quickwindowborder.h │ │ └── Widgets │ │ ├── FramelessDialog │ │ ├── FramelessMainWindow │ │ ├── FramelessWidget │ │ ├── FramelessWidgetsHelper │ │ ├── Global │ │ ├── StandardSystemButton │ │ ├── StandardTitleBar │ │ ├── framelessdialog.h │ │ ├── framelesshelperwidgets_global.h │ │ ├── framelessmainwindow.h │ │ ├── framelesswidget.h │ │ ├── framelesswidgetshelper.h │ │ ├── private │ │ ├── framelessdialog_p.h │ │ ├── framelessmainwindow_p.h │ │ ├── framelesswidget_p.h │ │ ├── framelesswidgetshelper_p.h │ │ ├── standardsystembutton_p.h │ │ ├── standardtitlebar_p.h │ │ └── widgetssharedhelper_p.h │ │ ├── standardsystembutton.h │ │ └── standardtitlebar.h ├── main.cpp ├── msbuild │ └── FramelessHelper.props ├── qmake │ ├── core.pri │ ├── inc │ │ └── core │ │ │ ├── framelesshelper.config │ │ │ └── framelesshelper.version │ ├── quick.pri │ └── widgets.pri └── src │ ├── CMakeLists.txt │ ├── core │ ├── CMakeLists.txt │ ├── chromepalette.cpp │ ├── chromepalette.h │ ├── chromepalette_p.h │ ├── framelessconfig.cpp │ ├── framelessconfig_p.h │ ├── framelesshelper_linux.h │ ├── framelesshelper_qt.cpp │ ├── framelesshelper_qt.h │ ├── framelesshelper_win.cpp │ ├── framelesshelper_win.h │ ├── framelesshelper_windows.h │ ├── framelesshelpercore.qrc │ ├── framelesshelpercore_global.cpp │ ├── framelesshelpercore_global.h │ ├── framelesshelpercore_global_p.h │ ├── framelessmanager.cpp │ ├── framelessmanager.h │ ├── framelessmanager_p.h │ ├── micamaterial.cpp │ ├── micamaterial.h │ ├── micamaterial_p.h │ ├── platformsupport_linux.cpp │ ├── platformsupport_win.cpp │ ├── registrykey.cpp │ ├── registrykey_p.h │ ├── resources │ │ ├── fonts │ │ │ └── iconfont.ttf │ │ └── images │ │ │ └── noise.png │ ├── scopeguard_p.h │ ├── sysapiloader.cpp │ ├── sysapiloader_p.h │ ├── utils.cpp │ ├── utils.h │ ├── utils_linux.cpp │ ├── utils_mac.mm │ ├── utils_win.cpp │ ├── versionnumber_p.h │ ├── windowborderpainter.cpp │ ├── windowborderpainter.h │ ├── windowborderpainter_p.h │ ├── winverhelper.cpp │ └── winverhelper_p.h │ ├── quick │ ├── CMakeLists.txt │ ├── framelesshelperquick_global.cpp │ ├── framelesshelperquick_global.h │ ├── framelessquickapplicationwindow.cpp │ ├── framelessquickapplicationwindow_p.h │ ├── framelessquickapplicationwindow_p_p.h │ ├── framelessquickhelper.cpp │ ├── framelessquickhelper.h │ ├── framelessquickhelper_p.h │ ├── framelessquickmodule.h │ ├── framelessquickutils.cpp │ ├── framelessquickutils.h │ ├── framelessquickwindow.cpp │ ├── framelessquickwindow_p.h │ ├── framelessquickwindow_p_p.h │ ├── quickchromepalette.cpp │ ├── quickchromepalette.h │ ├── quickimageitem.cpp │ ├── quickimageitem.h │ ├── quickimageitem_p.h │ ├── quickmicamaterial.cpp │ ├── quickmicamaterial.h │ ├── quickmicamaterial_p.h │ ├── quickstandardsystembutton.cpp │ ├── quickstandardsystembutton_p.h │ ├── quickstandardtitlebar.cpp │ ├── quickstandardtitlebar_p.h │ ├── quickwindowborder.cpp │ ├── quickwindowborder.h │ └── quickwindowborder_p.h │ └── widgets │ ├── CMakeLists.txt │ ├── framelessdialog.cpp │ ├── framelessdialog.h │ ├── framelessdialog_p.h │ ├── framelesshelperwidgets_global.cpp │ ├── framelesshelperwidgets_global.h │ ├── framelessmainwindow.cpp │ ├── framelessmainwindow.h │ ├── framelessmainwindow_p.h │ ├── framelesswidget.cpp │ ├── framelesswidget.h │ ├── framelesswidget_p.h │ ├── framelesswidgetshelper.cpp │ ├── framelesswidgetshelper.h │ ├── framelesswidgetshelper_p.h │ ├── standardsystembutton.cpp │ ├── standardsystembutton.h │ ├── standardsystembutton_p.h │ ├── standardtitlebar.cpp │ ├── standardtitlebar.h │ ├── standardtitlebar_p.h │ ├── widgetssharedhelper.cpp │ └── widgetssharedhelper_p.h ├── qml.qrc ├── screenshot ├── Dark.png └── Light.png ├── src ├── Def.cpp ├── Def.h ├── FluApp.cpp ├── FluApp.h ├── FluCaptcha.cpp ├── FluCaptcha.h ├── FluColorSet.cpp ├── FluColorSet.h ├── FluColors.cpp ├── FluColors.h ├── FluEventBus.cpp ├── FluEventBus.h ├── FluHttp.cpp ├── FluHttp.h ├── FluHttpInterceptor.cpp ├── FluHttpInterceptor.h ├── FluRectangle.cpp ├── FluRectangle.h ├── FluRegister.cpp ├── FluRegister.h ├── FluTextStyle.cpp ├── FluTextStyle.h ├── FluTheme.cpp ├── FluTheme.h ├── FluTools.cpp ├── FluTools.h ├── FluTreeModel.cpp ├── FluTreeModel.h ├── FluViewModel.cpp ├── FluViewModel.h ├── FluWatermark.cpp ├── FluWatermark.h ├── FluentUI.cpp ├── FluentUI.h ├── MainThread.cpp ├── MainThread.h ├── Qt5 │ └── imports │ │ ├── FluentUI │ │ ├── Controls │ │ │ ├── ColorPicker │ │ │ │ ├── ColorPicker.qml │ │ │ │ └── Content │ │ │ │ │ ├── Checkerboard.qml │ │ │ │ │ ├── ColorSlider.qml │ │ │ │ │ ├── NumberBox.qml │ │ │ │ │ ├── PanelBorder.qml │ │ │ │ │ └── SBPicker.qml │ │ │ ├── FluAcrylic.qml │ │ │ ├── FluAppBar.qml │ │ │ ├── FluArea.qml │ │ │ ├── FluAutoSuggestBox.qml │ │ │ ├── FluBadge.qml │ │ │ ├── FluBreadcrumbBar.qml │ │ │ ├── FluButton.qml │ │ │ ├── FluCalendarPicker.qml │ │ │ ├── FluCalendarView.qml │ │ │ ├── FluCarousel.qml │ │ │ ├── FluChart.qml │ │ │ ├── FluCheckBox.qml │ │ │ ├── FluClip.qml │ │ │ ├── FluColorPicker.qml │ │ │ ├── FluColorView.qml │ │ │ ├── FluComboBox.qml │ │ │ ├── FluContentDialog.qml │ │ │ ├── FluContentPage.qml │ │ │ ├── FluControl.qml │ │ │ ├── FluCopyableText.qml │ │ │ ├── FluDatePicker.qml │ │ │ ├── FluDivider.qml │ │ │ ├── FluDropDownButton.qml │ │ │ ├── FluExpander.qml │ │ │ ├── FluFilledButton.qml │ │ │ ├── FluFlipView.qml │ │ │ ├── FluFocusRectangle.qml │ │ │ ├── FluIcon.qml │ │ │ ├── FluIconButton.qml │ │ │ ├── FluImage.qml │ │ │ ├── FluInfoBar.qml │ │ │ ├── FluItemDelegate.qml │ │ │ ├── FluLoadingButton.qml │ │ │ ├── FluMenu.qml │ │ │ ├── FluMenuBar.qml │ │ │ ├── FluMenuBarItem.qml │ │ │ ├── FluMenuItem.qml │ │ │ ├── FluMenuSeparator.qml │ │ │ ├── FluMultilineTextBox.qml │ │ │ ├── FluNavigationView.qml │ │ │ ├── FluObject.qml │ │ │ ├── FluPage.qml │ │ │ ├── FluPagination.qml │ │ │ ├── FluPaneItem.qml │ │ │ ├── FluPaneItemEmpty.qml │ │ │ ├── FluPaneItemExpander.qml │ │ │ ├── FluPaneItemHeader.qml │ │ │ ├── FluPaneItemSeparator.qml │ │ │ ├── FluPasswordBox.qml │ │ │ ├── FluPivot.qml │ │ │ ├── FluPivotItem.qml │ │ │ ├── FluPopup.qml │ │ │ ├── FluProgressBar.qml │ │ │ ├── FluProgressButton.qml │ │ │ ├── FluProgressRing.qml │ │ │ ├── FluQRCode.qml │ │ │ ├── FluRadioButton.qml │ │ │ ├── FluRadioButtons.qml │ │ │ ├── FluRangeSlider.qml │ │ │ ├── FluRatingControl.qml │ │ │ ├── FluRemoteLoader.qml │ │ │ ├── FluScreenshot.qml │ │ │ ├── FluScrollBar.qml │ │ │ ├── FluScrollIndicator.qml │ │ │ ├── FluScrollablePage.qml │ │ │ ├── FluShadow.qml │ │ │ ├── FluSlider.qml │ │ │ ├── FluSpinBox.qml │ │ │ ├── FluStaggeredView.qml │ │ │ ├── FluStatusView.qml │ │ │ ├── FluTabView.qml │ │ │ ├── FluTableModelColumn.qml │ │ │ ├── FluTableView.qml │ │ │ ├── FluText.qml │ │ │ ├── FluTextBox.qml │ │ │ ├── FluTextBoxBackground.qml │ │ │ ├── FluTextBoxMenu.qml │ │ │ ├── FluTextButton.qml │ │ │ ├── FluTimePicker.qml │ │ │ ├── FluTimeline.qml │ │ │ ├── FluToggleButton.qml │ │ │ ├── FluToggleSwitch.qml │ │ │ ├── FluTooltip.qml │ │ │ ├── FluTour.qml │ │ │ ├── FluTreeView.qml │ │ │ └── FluWindow.qml │ │ ├── Font │ │ │ └── Segoe_Fluent_Icons.ttf │ │ ├── Image │ │ │ └── noise.png │ │ ├── JS │ │ │ └── Chart.js │ │ ├── plugins.qmltypes │ │ └── qmldir │ │ ├── fluentui.qrc │ │ └── start │ │ ├── App.qml │ │ ├── app.ico │ │ ├── qml │ │ ├── App.qml │ │ ├── component │ │ │ └── CodeExpander.qml │ │ ├── global │ │ │ ├── ItemsFooter.qml │ │ │ ├── ItemsOriginal.qml │ │ │ ├── Lang.qml │ │ │ └── qmldir │ │ ├── page │ │ │ ├── T_3D.qml │ │ │ ├── T_Acrylic.qml │ │ │ ├── T_Awesome.qml │ │ │ ├── T_Badge.qml │ │ │ ├── T_BreadcrumbBar.qml │ │ │ ├── T_Buttons.qml │ │ │ ├── T_CalendarPicker.qml │ │ │ ├── T_Captcha.qml │ │ │ ├── T_Carousel.qml │ │ │ ├── T_Chart.qml │ │ │ ├── T_CheckBox.qml │ │ │ ├── T_Clip.qml │ │ │ ├── T_ColorPicker.qml │ │ │ ├── T_ComboBox.qml │ │ │ ├── T_DatePicker.qml │ │ │ ├── T_Dialog.qml │ │ │ ├── T_Expander.qml │ │ │ ├── T_FlipView.qml │ │ │ ├── T_Home.qml │ │ │ ├── T_Http.qml │ │ │ ├── T_Image.qml │ │ │ ├── T_InfoBar.qml │ │ │ ├── T_Menu.qml │ │ │ ├── T_MultiWindow.qml │ │ │ ├── T_Pagination.qml │ │ │ ├── T_Pivot.qml │ │ │ ├── T_Progress.qml │ │ │ ├── T_QRCode.qml │ │ │ ├── T_RadioButton.qml │ │ │ ├── T_RatingControl.qml │ │ │ ├── T_Rectangle.qml │ │ │ ├── T_RemoteLoader.qml │ │ │ ├── T_Screenshot.qml │ │ │ ├── T_Settings.qml │ │ │ ├── T_Slider.qml │ │ │ ├── T_StaggeredView.qml │ │ │ ├── T_StatusView.qml │ │ │ ├── T_TabView.qml │ │ │ ├── T_TableView.qml │ │ │ ├── T_Text.qml │ │ │ ├── T_TextBox.qml │ │ │ ├── T_Theme.qml │ │ │ ├── T_TimePicker.qml │ │ │ ├── T_Timeline.qml │ │ │ ├── T_ToggleSwitch.qml │ │ │ ├── T_Tooltip.qml │ │ │ ├── T_Tour.qml │ │ │ ├── T_TreeView.qml │ │ │ ├── T_Typography.qml │ │ │ └── T_Watermark.qml │ │ ├── viewmodel │ │ │ ├── SettingsViewModel.qml │ │ │ └── TextBoxViewModel.qml │ │ └── window │ │ │ ├── AboutWindow.qml │ │ │ ├── HotloadWindow.qml │ │ │ ├── LoginWindow.qml │ │ │ ├── MainWindow.qml │ │ │ ├── PageWindow.qml │ │ │ ├── SingleInstanceWindow.qml │ │ │ ├── SingleTaskWindow.qml │ │ │ └── StandardWindow.qml │ │ └── res │ │ ├── image │ │ ├── app.ico │ │ ├── banner_1.jpg │ │ ├── banner_2.jpg │ │ ├── banner_3.jpg │ │ ├── bg_home_header.png │ │ ├── bg_scenic.png │ │ ├── control │ │ │ ├── Acrylic.png │ │ │ ├── AnimatedIcon.png │ │ │ ├── AnimatedVisualPlayer.png │ │ │ ├── AnimationInterop.png │ │ │ ├── AppBarButton.png │ │ │ ├── AppBarSeparator.png │ │ │ ├── AppBarToggleButton.png │ │ │ ├── AutoSuggestBox.png │ │ │ ├── AutomationProperties.png │ │ │ ├── Border.png │ │ │ ├── BreadcrumbBar.png │ │ │ ├── Button.png │ │ │ ├── CalendarDatePicker.png │ │ │ ├── CalendarView.png │ │ │ ├── Canvas.png │ │ │ ├── Checkbox.png │ │ │ ├── Clipboard.png │ │ │ ├── ColorPaletteResources.png │ │ │ ├── ColorPicker.png │ │ │ ├── ComboBox.png │ │ │ ├── CommandBar.png │ │ │ ├── CommandBarFlyout.png │ │ │ ├── CompactSizing.png │ │ │ ├── ConnectedAnimation.png │ │ │ ├── ContentDialog.png │ │ │ ├── CreateMultipleWindows.png │ │ │ ├── DataGrid.png │ │ │ ├── DatePicker.png │ │ │ ├── DropDownButton.png │ │ │ ├── EasingFunction.png │ │ │ ├── Expander.png │ │ │ ├── FilePicker.png │ │ │ ├── FlipView.png │ │ │ ├── Flyout.png │ │ │ ├── Grid.png │ │ │ ├── GridView.png │ │ │ ├── HyperlinkButton.png │ │ │ ├── IconElement.png │ │ │ ├── Image.png │ │ │ ├── ImplicitTransition.png │ │ │ ├── InfoBadge.png │ │ │ ├── InfoBar.png │ │ │ ├── InkCanvas.png │ │ │ ├── InkToolbar.png │ │ │ ├── InputValidation.png │ │ │ ├── ItemsRepeater.png │ │ │ ├── Line.png │ │ │ ├── ListBox.png │ │ │ ├── ListView.png │ │ │ ├── MediaPlayerElement.png │ │ │ ├── MenuBar.png │ │ │ ├── MenuFlyout.png │ │ │ ├── NavigationView.png │ │ │ ├── NumberBox.png │ │ │ ├── PageTransition.png │ │ │ ├── ParallaxView.png │ │ │ ├── PasswordBox.png │ │ │ ├── PersonPicture.png │ │ │ ├── PipsPager.png │ │ │ ├── Pivot.png │ │ │ ├── ProgressBar.png │ │ │ ├── ProgressRing.png │ │ │ ├── PullToRefresh.png │ │ │ ├── RadialGradientBrush.png │ │ │ ├── RadioButton.png │ │ │ ├── RadioButtons.png │ │ │ ├── RatingControl.png │ │ │ ├── RelativePanel.png │ │ │ ├── RepeatButton.png │ │ │ ├── RevealFocus.png │ │ │ ├── RichEditBox.png │ │ │ ├── RichTextBlock.png │ │ │ ├── ScrollViewer.png │ │ │ ├── SemanticZoom.png │ │ │ ├── Shape.png │ │ │ ├── Slider.png │ │ │ ├── Sound.png │ │ │ ├── SplitButton.png │ │ │ ├── SplitView.png │ │ │ ├── StackPanel.png │ │ │ ├── StandardUICommand.png │ │ │ ├── SwipeControl.png │ │ │ ├── TabView.png │ │ │ ├── TeachingTip.png │ │ │ ├── TextBlock.png │ │ │ ├── TextBox.png │ │ │ ├── ThemeTransition.png │ │ │ ├── TimePicker.png │ │ │ ├── TitleBar.png │ │ │ ├── ToggleButton.png │ │ │ ├── ToggleSplitButton.png │ │ │ ├── ToggleSwitch.png │ │ │ ├── ToolTip.png │ │ │ ├── TreeView.png │ │ │ ├── VariableSizedWrapGrid.png │ │ │ ├── Viewbox.png │ │ │ ├── WebView.png │ │ │ └── XamlUICommand.png │ │ ├── favicon.ico │ │ ├── ic_home_github.png │ │ ├── image_1.jpg │ │ ├── logo_openai.png │ │ ├── qrcode_adeshsingh.png │ │ ├── qrcode_wx.jpg │ │ └── qrcode_zfb.jpg │ │ └── svg │ │ ├── avatar_1.svg │ │ ├── avatar_10.svg │ │ ├── avatar_11.svg │ │ ├── avatar_12.svg │ │ ├── avatar_2.svg │ │ ├── avatar_3.svg │ │ ├── avatar_4.svg │ │ ├── avatar_5.svg │ │ ├── avatar_6.svg │ │ ├── avatar_7.svg │ │ ├── avatar_8.svg │ │ ├── avatar_9.svg │ │ ├── home.svg │ │ └── home_dark.svg ├── Screenshot.cpp ├── Screenshot.h ├── WindowLifecycle.cpp ├── WindowLifecycle.h ├── singleton.h ├── start │ ├── Version.h │ ├── main.cpp │ └── src │ │ ├── AppInfo.cpp │ │ ├── AppInfo.h │ │ ├── component │ │ ├── CircularReveal.cpp │ │ ├── CircularReveal.h │ │ ├── FileWatcher.cpp │ │ ├── FileWatcher.h │ │ ├── FpsItem.cpp │ │ └── FpsItem.h │ │ ├── helper │ │ ├── SettingsHelper.cpp │ │ └── SettingsHelper.h │ │ ├── singleton.h │ │ └── stdafx.h └── stdafx.h └── start ├── FluAppBar.qml ├── FluIcon.qml ├── FluIconButton.qml ├── FluToggleSwitch.qml ├── Font └── Segoe_Fluent_Icons.ttf ├── MainWindow.qml ├── StandardWindow.qml ├── Version.h ├── favicon.ico ├── main.cpp └── src ├── AppInfo.cpp ├── AppInfo.h ├── Def.cpp ├── Def.h ├── FluTextStyle.cpp ├── FluTextStyle.h ├── component ├── CircularReveal.cpp ├── CircularReveal.h ├── FileWatcher.cpp ├── FileWatcher.h ├── FpsItem.cpp └── FpsItem.h ├── helper ├── SettingsHelper.cpp └── SettingsHelper.h ├── singleton.h └── stdafx.h /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "windows-gcc-x64", 5 | "includePath": [ 6 | "${workspaceFolder}/**" 7 | ], 8 | "compilerPath": "C:/Strawberry/c/bin/gcc.exe", 9 | "cStandard": "${default}", 10 | "cppStandard": "${default}", 11 | "intelliSenseMode": "windows-gcc-x64", 12 | "compilerArgs": [ 13 | "" 14 | ] 15 | } 16 | ], 17 | "version": 4 18 | } -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "C/C++ Runner: Debug Session", 6 | "type": "cppdbg", 7 | "request": "launch", 8 | "args": [], 9 | "stopAtEntry": false, 10 | "externalConsole": true, 11 | "cwd": "c:/Users/ADMIN/Documents/HelperWindow/start", 12 | "program": "c:/Users/ADMIN/Documents/HelperWindow/start/build/Debug/outDebug", 13 | "MIMode": "gdb", 14 | "miDebuggerPath": "gdb", 15 | "setupCommands": [ 16 | { 17 | "description": "Enable pretty-printing for gdb", 18 | "text": "-enable-pretty-printing", 19 | "ignoreFailures": true 20 | } 21 | ] 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "C_Cpp_Runner.cCompilerPath": "gcc", 3 | "C_Cpp_Runner.cppCompilerPath": "g++", 4 | "C_Cpp_Runner.debuggerPath": "gdb", 5 | "C_Cpp_Runner.cStandard": "", 6 | "C_Cpp_Runner.cppStandard": "", 7 | "C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvarsall.bat", 8 | "C_Cpp_Runner.useMsvc": false, 9 | "C_Cpp_Runner.warnings": [ 10 | "-Wall", 11 | "-Wextra", 12 | "-Wpedantic", 13 | "-Wshadow", 14 | "-Wformat=2", 15 | "-Wcast-align", 16 | "-Wconversion", 17 | "-Wsign-conversion", 18 | "-Wnull-dereference" 19 | ], 20 | "C_Cpp_Runner.msvcWarnings": [ 21 | "/W4", 22 | "/permissive-", 23 | "/w14242", 24 | "/w14287", 25 | "/w14296", 26 | "/w14311", 27 | "/w14826", 28 | "/w44062", 29 | "/w44242", 30 | "/w14905", 31 | "/w14906", 32 | "/w14263", 33 | "/w44265", 34 | "/w14928" 35 | ], 36 | "C_Cpp_Runner.enableWarnings": true, 37 | "C_Cpp_Runner.warningsAsError": false, 38 | "C_Cpp_Runner.compilerArgs": [], 39 | "C_Cpp_Runner.linkerArgs": [], 40 | "C_Cpp_Runner.includePaths": [], 41 | "C_Cpp_Runner.includeSearch": [ 42 | "*", 43 | "**/*" 44 | ], 45 | "C_Cpp_Runner.excludeSearch": [ 46 | "**/build", 47 | "**/build/**", 48 | "**/.*", 49 | "**/.*/**", 50 | "**/.vscode", 51 | "**/.vscode/**" 52 | ], 53 | "C_Cpp_Runner.useAddressSanitizer": false, 54 | "C_Cpp_Runner.useUndefinedSanitizer": false, 55 | "C_Cpp_Runner.useLeakSanitizer": false, 56 | "C_Cpp_Runner.showCompilationTime": false, 57 | "C_Cpp_Runner.useLinkTimeOptimization": false, 58 | "C_Cpp_Runner.msvcSecureNoWarnings": false 59 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # frameless-window 2 | QT QML Frameless Window 3 | ![light](https://github.com/cppqtdev/frameless-window/blob/development/screenshot/Light.png) 4 | 5 | ![dark](https://github.com/cppqtdev/frameless-window/blob/development/screenshot/Dark.png) 6 | -------------------------------------------------------------------------------- /framelesshelper/.gitignore: -------------------------------------------------------------------------------- 1 | # C++ objects and libs 2 | *.slo 3 | *.lo 4 | *.o 5 | *.a 6 | *.la 7 | *.lai 8 | *.so 9 | *.so.* 10 | *.dll 11 | *.dylib 12 | 13 | # Qt-es 14 | object_script.*.Release 15 | object_script.*.Debug 16 | *_plugin_import.cpp 17 | /.qmake.cache 18 | /.qmake.stash 19 | *.pro.user 20 | *.pro.user.* 21 | *.qbs.user 22 | *.qbs.user.* 23 | *.moc 24 | moc_*.cpp 25 | moc_*.h 26 | qrc_*.cpp 27 | ui_*.h 28 | *.qmlc 29 | *.jsc 30 | Makefile* 31 | *build-* 32 | *.qm 33 | *.prl 34 | 35 | # Qt unit tests 36 | target_wrapper.* 37 | 38 | # QtCreator 39 | *.autosave 40 | 41 | # QtCreator Qml 42 | *.qmlproject.user 43 | *.qmlproject.user.* 44 | 45 | # QtCreator CMake 46 | CMakeLists.txt.user* 47 | 48 | # QtCreator 4.8< compilation database 49 | compile_commands.json 50 | 51 | # QtCreator local machine specific files for imported projects 52 | *creator.user* 53 | 54 | # My 55 | [Bb]in/ 56 | [Bb]in64/ 57 | [Ll]ib/ 58 | [Ll]ib64/ 59 | [Bb]uild*/ 60 | *.7z 61 | *.zip 62 | *.rar 63 | *.tar 64 | *.gz 65 | *.xz 66 | *.exe 67 | *.lib 68 | *.pdb 69 | *.ilk 70 | *.exp 71 | *.obj 72 | build.user.bat 73 | build.user.sh 74 | user.conf 75 | [Dd]oc/ 76 | [Dd]ocs/ 77 | Thumbs.db 78 | *.rc 79 | *.bin 80 | *.run 81 | .qmake.conf 82 | *.res 83 | .DS_Store 84 | .vscode/ 85 | .vs/ 86 | .cmake.conf 87 | -------------------------------------------------------------------------------- /framelesshelper/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "cmake"] 2 | path = cmake 3 | url = ../../wangwenx190/cmake-utils.git 4 | -------------------------------------------------------------------------------- /framelesshelper/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /framelesshelper/cmake/.gitignore: -------------------------------------------------------------------------------- 1 | CMakeLists.txt.user 2 | CMakeCache.txt 3 | CMakeFiles 4 | CMakeScripts 5 | Testing 6 | Makefile 7 | cmake_install.cmake 8 | install_manifest.txt 9 | compile_commands.json 10 | CTestTestfile.cmake 11 | _deps 12 | -------------------------------------------------------------------------------- /framelesshelper/cmake/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (C) 2023 by wangwenx190 (Yuhang Zhao) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /framelesshelper/cmake/LLVM-Install.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set IsTextMode=No 4 | 5 | echo LLVM Installer [Version 0.1.0] 6 | echo Based on VC-LTL installer. Copyright (C) Chuyu Team. All rights reserved. 7 | echo. 8 | 9 | if /i "%1"=="" goto TextMode 10 | if /i "%1"=="/?" goto Help 11 | if /i "%1"=="/I" goto Install 12 | if /i "%1"=="/U" goto UnInstall 13 | 14 | echo Invaild Command Parameter. 15 | echo. 16 | goto Help 17 | 18 | :Install 19 | set Root=%~dp0 20 | set Root=%Root:~0,-1% 21 | echo. 22 | echo.Start writing to the registry 23 | echo.[HKCU\Code\LLVM] 24 | echo.Root="%Root%" 25 | echo. 26 | reg ADD HKCU\Code\LLVM /v Root /t REG_SZ /d "%Root%" /f 27 | echo. 28 | goto ExitScript 29 | 30 | :UnInstall 31 | echo. 32 | reg delete HKCU\Code\LLVM /f 33 | echo. 34 | goto ExitScript 35 | 36 | :Help 37 | echo.Manages LLVM information in the current user registry. 38 | echo. 39 | echo.Install [Options] 40 | echo. 41 | echo. /I Add LLVM information to the current user registry. 42 | echo. /U Remove LLVM information to the current user registry. 43 | echo. /? Show this content. 44 | goto ExitScript 45 | 46 | :TextMode 47 | set IsTextMode=Yes 48 | echo.Welcome to use LLVM Installer! If you want to invoke this script 49 | echo.silently, please use /? parameter to read help. 50 | reg query HKCU\Code\LLVM /v Root >nul 2>nul && goto TextUnInstall || goto Install 51 | 52 | :TextUnInstall 53 | echo. 54 | set /p Answer=LLVM appears to be installed, do you want to uninstall it (Y/N)? 55 | if /i "%Answer%"=="Y" goto UnInstall 56 | echo. 57 | echo.Operation canceled. 58 | echo. 59 | goto ExitScript 60 | 61 | :ExitScript 62 | if /i "%IsTextMode%"=="Yes" pause 63 | @echo on 64 | -------------------------------------------------------------------------------- /framelesshelper/cmake/README.md: -------------------------------------------------------------------------------- 1 | # cmake-utils 2 | CMake helper utilities 3 | -------------------------------------------------------------------------------- /framelesshelper/cmake/YY-Thunks-Install.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set IsTextMode=No 4 | 5 | echo YY-Thunks Installer [Version 0.1.0] 6 | echo Based on VC-LTL installer. Copyright (C) Chuyu Team. All rights reserved. 7 | echo. 8 | 9 | if /i "%1"=="" goto TextMode 10 | if /i "%1"=="/?" goto Help 11 | if /i "%1"=="/I" goto Install 12 | if /i "%1"=="/U" goto UnInstall 13 | 14 | echo Invaild Command Parameter. 15 | echo. 16 | goto Help 17 | 18 | :Install 19 | set Root=%~dp0 20 | set Root=%Root:~0,-1% 21 | echo. 22 | echo.Start writing to the registry 23 | echo.[HKCU\Code\YY-Thunks] 24 | echo.Root="%Root%" 25 | echo. 26 | reg ADD HKCU\Code\YY-Thunks /v Root /t REG_SZ /d "%Root%" /f 27 | echo. 28 | goto ExitScript 29 | 30 | :UnInstall 31 | echo. 32 | reg delete HKCU\Code\YY-Thunks /f 33 | echo. 34 | goto ExitScript 35 | 36 | :Help 37 | echo.Manages YY-Thunks information in the current user registry. 38 | echo. 39 | echo.Install [Options] 40 | echo. 41 | echo. /I Add YY-Thunks information to the current user registry. 42 | echo. /U Remove YY-Thunks information to the current user registry. 43 | echo. /? Show this content. 44 | goto ExitScript 45 | 46 | :TextMode 47 | set IsTextMode=Yes 48 | echo.Welcome to use YY-Thunks Installer! If you want to invoke this script 49 | echo.silently, please use /? parameter to read help. 50 | reg query HKCU\Code\YY-Thunks /v Root >nul 2>nul && goto TextUnInstall || goto Install 51 | 52 | :TextUnInstall 53 | echo. 54 | set /p Answer=YY-Thunks appears to be installed, do you want to uninstall it (Y/N)? 55 | if /i "%Answer%"=="Y" goto UnInstall 56 | echo. 57 | echo.Operation canceled. 58 | echo. 59 | goto ExitScript 60 | 61 | :ExitScript 62 | if /i "%IsTextMode%"=="Yes" pause 63 | @echo on 64 | -------------------------------------------------------------------------------- /framelesshelper/cmake/setup-proxy.ps1: -------------------------------------------------------------------------------- 1 | # MIT License 2 | # 3 | # Copyright (C) 2023 by wangwenx190 (Yuhang Zhao) 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | # SOFTWARE. 22 | 23 | $__proxy_enable = Get-ItemPropertyValue "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" "ProxyEnable" 24 | $__proxy_server = Get-ItemPropertyValue "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" "ProxyServer" 25 | if ($__proxy_enable -eq 1) { 26 | $env:HTTP_PROXY="http://$__proxy_server" 27 | $env:HTTPS_PROXY="http://$__proxy_server" 28 | $env:ALL_PROXY="http://$__proxy_server" 29 | } else { 30 | $env:HTTP_PROXY="" 31 | $env:HTTPS_PROXY="" 32 | $env:ALL_PROXY="" 33 | } 34 | Write-Host "HTTP_PROXY:" $env:HTTP_PROXY 35 | Write-Host "HTTPS_PROXY:" $env:HTTPS_PROXY 36 | Write-Host "ALL_PROXY:" $env:ALL_PROXY 37 | -------------------------------------------------------------------------------- /framelesshelper/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #[[ 2 | MIT License 3 | 4 | Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | ]] 24 | 25 | if(FRAMELESSHELPER_BUILD_WIDGETS AND TARGET Qt${QT_VERSION_MAJOR}::Widgets) 26 | add_subdirectory(widget) 27 | add_subdirectory(mainwindow) 28 | #add_subdirectory(openglwidget) # Currently not functional. 29 | add_subdirectory(dialog) 30 | endif() 31 | 32 | if(FRAMELESSHELPER_BUILD_QUICK AND TARGET Qt${QT_VERSION_MAJOR}::Quick AND (QT_VERSION_MAJOR GREATER_EQUAL 6) AND (NOT FRAMELESSHELPER_NO_PRIVATE)) 33 | add_subdirectory(quick) 34 | endif() 35 | -------------------------------------------------------------------------------- /framelesshelper/examples/dialog/dialog.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | FRAMELESSHELPER_REQUIRE_CONFIG(window) 9 | 10 | QT_BEGIN_NAMESPACE 11 | class QCheckBox; 12 | class QDialogButtonBox; 13 | class QGroupBox; 14 | class QLabel; 15 | class QLineEdit; 16 | class QPushButton; 17 | QT_END_NAMESPACE 18 | 19 | #if FRAMELESSHELPER_CONFIG(titlebar) 20 | FRAMELESSHELPER_BEGIN_NAMESPACE 21 | class StandardTitleBar; 22 | FRAMELESSHELPER_END_NAMESPACE 23 | #endif 24 | 25 | class Dialog : public FRAMELESSHELPER_PREPEND_NAMESPACE(FramelessDialog) 26 | { 27 | Q_OBJECT 28 | Q_DISABLE_COPY(Dialog) 29 | 30 | public: 31 | explicit Dialog(QWidget *parent = nullptr); 32 | ~Dialog() override; 33 | 34 | void waitReady(); 35 | 36 | protected: 37 | void closeEvent(QCloseEvent *event) override; 38 | 39 | private: 40 | void setupUi(); 41 | 42 | private: 43 | #if FRAMELESSHELPER_CONFIG(titlebar) 44 | FRAMELESSHELPER_PREPEND_NAMESPACE(StandardTitleBar) *titleBar = nullptr; 45 | #endif 46 | QLabel *label = nullptr; 47 | QLineEdit *lineEdit = nullptr; 48 | QCheckBox *caseCheckBox = nullptr; 49 | QCheckBox *fromStartCheckBox = nullptr; 50 | QCheckBox *wholeWordsCheckBox = nullptr; 51 | QCheckBox *searchSelectionCheckBox = nullptr; 52 | QCheckBox *backwardCheckBox = nullptr; 53 | QDialogButtonBox *buttonBox = nullptr; 54 | QPushButton *findButton = nullptr; 55 | QPushButton *moreButton = nullptr; 56 | QWidget *extension = nullptr; 57 | }; 58 | -------------------------------------------------------------------------------- /framelesshelper/examples/openglwidget/images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/qtlogo.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /framelesshelper/examples/openglwidget/images/qtlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/framelesshelper/examples/openglwidget/images/qtlogo.png -------------------------------------------------------------------------------- /framelesshelper/examples/quick/images/microsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/framelesshelper/examples/quick/images/microsoft.png -------------------------------------------------------------------------------- /framelesshelper/examples/quick/images/microsoft.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /framelesshelper/examples/quick/qml/HomePage.qml: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import QtQml 2.3 26 | 27 | QtObject { 28 | property Window window: Window{} 29 | //property ApplicationWindow applicationWindow: ApplicationWindow{} 30 | 31 | Component.onCompleted: { 32 | window.show(); 33 | // applicationWindow.show(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /framelesshelper/examples/quick/quick.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += c++1z 3 | TARGET = FramelessHelperDemo-Quick 4 | QT += qml quick quickcontrols2 5 | DEFINES += QUICK_USE_QMAKE 6 | HEADERS += \ 7 | ../shared/log.h \ 8 | ../shared/settings.h \ 9 | quicksettings.h 10 | SOURCES += \ 11 | ../shared/log.cpp \ 12 | ../shared/settings.cpp \ 13 | quicksettings.cpp \ 14 | main.cpp 15 | RESOURCES += resources.qrc 16 | include(../../qmake/core.pri) 17 | include(../../qmake/quick.pri) 18 | -------------------------------------------------------------------------------- /framelesshelper/examples/quick/quicksettings.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | #include 29 | 30 | class QuickSettings : public QObject 31 | { 32 | Q_OBJECT 33 | #ifdef QML_NAMED_ELEMENT 34 | QML_NAMED_ELEMENT(Settings) 35 | #endif 36 | #ifdef QML_SINGLETON 37 | QML_SINGLETON 38 | #endif 39 | Q_DISABLE_COPY(QuickSettings) 40 | 41 | public: 42 | explicit QuickSettings(QObject *parent = nullptr); 43 | ~QuickSettings() override; 44 | 45 | public Q_SLOTS: 46 | void saveGeometry(QWindow *window); 47 | Q_NODISCARD bool restoreGeometry(QWindow *window); 48 | }; 49 | -------------------------------------------------------------------------------- /framelesshelper/examples/quick/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/microsoft.svg 4 | qml/Window.qml 5 | qml/ApplicationWindow.qml 6 | qml/HomePage.qml 7 | 8 | 9 | -------------------------------------------------------------------------------- /framelesshelper/examples/quick/scripts/d3d11.bat: -------------------------------------------------------------------------------- 1 | :: MIT License 2 | :: 3 | :: Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 4 | :: 5 | :: Permission is hereby granted, free of charge, to any person obtaining a copy 6 | :: of this software and associated documentation files (the "Software"), to deal 7 | :: in the Software without restriction, including without limitation the rights 8 | :: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | :: copies of the Software, and to permit persons to whom the Software is 10 | :: furnished to do so, subject to the following conditions: 11 | :: 12 | :: The above copyright notice and this permission notice shall be included in 13 | :: all copies or substantial portions of the Software. 14 | :: 15 | :: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | :: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | :: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | :: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | :: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | :: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | :: SOFTWARE. 22 | 23 | @echo off 24 | setlocal 25 | set QSG_RHI_BACKEND=d3d11 26 | "%~dp0FramelessHelperDemo-Quick.exe" 27 | endlocal 28 | exit /b 0 29 | -------------------------------------------------------------------------------- /framelesshelper/examples/quick/scripts/d3d12.bat: -------------------------------------------------------------------------------- 1 | :: MIT License 2 | :: 3 | :: Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 4 | :: 5 | :: Permission is hereby granted, free of charge, to any person obtaining a copy 6 | :: of this software and associated documentation files (the "Software"), to deal 7 | :: in the Software without restriction, including without limitation the rights 8 | :: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | :: copies of the Software, and to permit persons to whom the Software is 10 | :: furnished to do so, subject to the following conditions: 11 | :: 12 | :: The above copyright notice and this permission notice shall be included in 13 | :: all copies or substantial portions of the Software. 14 | :: 15 | :: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | :: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | :: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | :: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | :: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | :: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | :: SOFTWARE. 22 | 23 | @echo off 24 | setlocal 25 | set QSG_RHI_BACKEND=d3d12 26 | "%~dp0FramelessHelperDemo-Quick.exe" 27 | endlocal 28 | exit /b 0 29 | -------------------------------------------------------------------------------- /framelesshelper/examples/quick/scripts/opengl.bat: -------------------------------------------------------------------------------- 1 | :: MIT License 2 | :: 3 | :: Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 4 | :: 5 | :: Permission is hereby granted, free of charge, to any person obtaining a copy 6 | :: of this software and associated documentation files (the "Software"), to deal 7 | :: in the Software without restriction, including without limitation the rights 8 | :: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | :: copies of the Software, and to permit persons to whom the Software is 10 | :: furnished to do so, subject to the following conditions: 11 | :: 12 | :: The above copyright notice and this permission notice shall be included in 13 | :: all copies or substantial portions of the Software. 14 | :: 15 | :: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | :: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | :: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | :: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | :: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | :: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | :: SOFTWARE. 22 | 23 | @echo off 24 | setlocal 25 | set QSG_RHI_BACKEND=opengl 26 | "%~dp0FramelessHelperDemo-Quick.exe" 27 | endlocal 28 | exit /b 0 29 | -------------------------------------------------------------------------------- /framelesshelper/examples/quick/scripts/vulkan.bat: -------------------------------------------------------------------------------- 1 | :: MIT License 2 | :: 3 | :: Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 4 | :: 5 | :: Permission is hereby granted, free of charge, to any person obtaining a copy 6 | :: of this software and associated documentation files (the "Software"), to deal 7 | :: in the Software without restriction, including without limitation the rights 8 | :: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | :: copies of the Software, and to permit persons to whom the Software is 10 | :: furnished to do so, subject to the following conditions: 11 | :: 12 | :: The above copyright notice and this permission notice shall be included in 13 | :: all copies or substantial portions of the Software. 14 | :: 15 | :: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | :: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | :: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | :: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | :: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | :: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | :: SOFTWARE. 22 | 23 | @echo off 24 | setlocal 25 | set QSG_RHI_BACKEND=vulkan 26 | "%~dp0FramelessHelperDemo-Quick.exe" 27 | endlocal 28 | exit /b 0 29 | -------------------------------------------------------------------------------- /framelesshelper/examples/shared/example.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/framelesshelper/examples/shared/example.ico -------------------------------------------------------------------------------- /framelesshelper/examples/shared/log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | 29 | namespace Log 30 | { 31 | void setup(const QString &app); 32 | } // namespace Log 33 | -------------------------------------------------------------------------------- /framelesshelper/examples/shared/settings.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | 29 | namespace Settings 30 | { 31 | template 32 | void set(const QString &id, const QString &key, const T &data); 33 | 34 | template 35 | [[nodiscard]] T get(const QString &id, const QString &key); 36 | } // namespace Settings 37 | -------------------------------------------------------------------------------- /framelesshelper/examples/widget/widget.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | TARGET = FramelessHelperDemo-Widget 3 | QT += widgets 4 | HEADERS += \ 5 | ../shared/log.h \ 6 | ../shared/settings.h \ 7 | widget.h 8 | SOURCES += \ 9 | ../shared/log.cpp \ 10 | ../shared/settings.cpp \ 11 | widget.cpp \ 12 | main.cpp 13 | include(../../qmake/core.pri) 14 | include(../../qmake/widgets.pri) 15 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Core/ChromePalette: -------------------------------------------------------------------------------- 1 | #include "chromepalette.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Core/FramelessHelper_Linux: -------------------------------------------------------------------------------- 1 | #include "framelesshelper_linux.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Core/FramelessHelper_Qt: -------------------------------------------------------------------------------- 1 | #include "framelesshelper_qt.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Core/FramelessHelper_Win: -------------------------------------------------------------------------------- 1 | #include "framelesshelper_win.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Core/FramelessHelper_Windows: -------------------------------------------------------------------------------- 1 | #include "framelesshelper_windows.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Core/FramelessManager: -------------------------------------------------------------------------------- 1 | #include "framelessmanager.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Core/Global: -------------------------------------------------------------------------------- 1 | #include "framelesshelpercore_global.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Core/MicaMaterial: -------------------------------------------------------------------------------- 1 | #include "micamaterial.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Core/Utils: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Core/WindowBorderPainter: -------------------------------------------------------------------------------- 1 | #include "windowborderpainter.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Quick/FramelessQuickHelper: -------------------------------------------------------------------------------- 1 | #include "framelessquickhelper.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Quick/FramelessQuickModule: -------------------------------------------------------------------------------- 1 | #include "framelessquickmodule.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Quick/FramelessQuickUtils: -------------------------------------------------------------------------------- 1 | #include "framelessquickutils.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Quick/Global: -------------------------------------------------------------------------------- 1 | #include "framelesshelperquick_global.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Quick/QuickChromePalette: -------------------------------------------------------------------------------- 1 | #include "quickchromepalette.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Quick/QuickMicaMaterial: -------------------------------------------------------------------------------- 1 | #include "quickmicamaterial.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Quick/QuickWindowBorder: -------------------------------------------------------------------------------- 1 | #include "quickwindowborder.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Quick/framelessquickmodule.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | 29 | QT_BEGIN_NAMESPACE 30 | class QQmlEngine; 31 | QT_END_NAMESPACE 32 | 33 | FRAMELESSHELPER_BEGIN_NAMESPACE 34 | 35 | namespace FramelessHelper::Quick 36 | { 37 | inline void registerTypes(QQmlEngine *engine) { FramelessHelperQuickRegisterTypes(engine); } 38 | } // namespace FramelessHelper::Quick 39 | 40 | FRAMELESSHELPER_END_NAMESPACE 41 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Widgets/FramelessDialog: -------------------------------------------------------------------------------- 1 | #include "framelessdialog.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Widgets/FramelessMainWindow: -------------------------------------------------------------------------------- 1 | #include "framelessmainwindow.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Widgets/FramelessWidget: -------------------------------------------------------------------------------- 1 | #include "framelesswidget.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Widgets/FramelessWidgetsHelper: -------------------------------------------------------------------------------- 1 | #include "framelesswidgetshelper.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Widgets/Global: -------------------------------------------------------------------------------- 1 | #include "framelesshelperwidgets_global.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Widgets/StandardSystemButton: -------------------------------------------------------------------------------- 1 | #include "standardsystembutton.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Widgets/StandardTitleBar: -------------------------------------------------------------------------------- 1 | #include "standardtitlebar.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/include/FramelessHelper/Widgets/framelessdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #if FRAMELESSHELPER_CONFIG(window) 32 | 33 | FRAMELESSHELPER_BEGIN_NAMESPACE 34 | 35 | class FramelessDialogPrivate; 36 | class FRAMELESSHELPER_WIDGETS_API FramelessDialog : public QDialog 37 | { 38 | Q_OBJECT 39 | FRAMELESSHELPER_PUBLIC_QT_CLASS(FramelessDialog) 40 | 41 | public: 42 | explicit FramelessDialog(QWidget *parent = nullptr); 43 | ~FramelessDialog() override; 44 | }; 45 | 46 | FRAMELESSHELPER_END_NAMESPACE 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /framelesshelper/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "framelessquickhelper_p.h" 7 | 8 | int main(int argc, char *argv[]) 9 | { 10 | FramelessHelper::Quick::initialize(); 11 | 12 | QGuiApplication app(argc, argv); 13 | 14 | QQmlApplicationEngine engine; 15 | FramelessHelper::Quick::registerTypes(&engine); 16 | const QUrl url(QStringLiteral("qrc:/qml/App.qml")); 17 | QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, 18 | &app, [url](QObject *obj, const QUrl &objUrl) { 19 | if (!obj && url == objUrl) 20 | QCoreApplication::exit(-1); 21 | }, Qt::QueuedConnection); 22 | engine.load(url); 23 | const int exec = QGuiApplication::exec(); 24 | if (exec == 931) { 25 | QProcess::startDetached(qApp->applicationFilePath(), QStringList()); 26 | } 27 | return exec; 28 | } 29 | -------------------------------------------------------------------------------- /framelesshelper/msbuild/FramelessHelper.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildThisFileDirectory)..\lib;$(MSBuildThisFileDirectory)..\lib\debug;$(MSBuildThisFileDirectory)..\lib\release;$(LibraryPath) 5 | 6 | 7 | $(MSBuildThisFileDirectory)..\include;$(MSBuildThisFileDirectory)..\include\FramelessHelper;$(MSBuildThisFileDirectory)..\include\FramelessHelper\Core;$(MSBuildThisFileDirectory)..\include\FramelessHelper\Core\private;$(MSBuildThisFileDirectory)..\include\FramelessHelper\Widgets;$(MSBuildThisFileDirectory)..\include\FramelessHelper\Widgets\private;$(MSBuildThisFileDirectory)..\include\FramelessHelper\Quick;$(MSBuildThisFileDirectory)..\include\FramelessHelper\Quick\private;$(QtHeaderSearchPath) 8 | 9 | 10 | 11 | %(PreprocessorDefinitions) 12 | 13 | 14 | FramelessHelperCore64d.lib;FramelessHelperWidgets64d.lib;FramelessHelperQuick64d.lib;%(AdditionalDependencies); 15 | FramelessHelperCore64.lib;FramelessHelperWidgets64.lib;FramelessHelperQuick64.lib;%(AdditionalDependencies); 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /framelesshelper/qmake/widgets.pri: -------------------------------------------------------------------------------- 1 | QT += widgets 2 | 3 | BASE_INC_DIR = $$PWD/../include 4 | COMMON_INC_DIR = $$BASE_INC_DIR/FramelessHelper 5 | WIDGETS_PUB_INC_DIR = $$COMMON_INC_DIR/Widgets 6 | WIDGETS_PRIV_INC_DIR = $$WIDGETS_PUB_INC_DIR/private 7 | WIDGETS_SRC_DIR = $$PWD/../src/widgets 8 | 9 | INCLUDEPATH += \ 10 | $$BASE_INC_DIR \ 11 | $$COMMON_INC_DIR \ 12 | $$WIDGETS_PUB_INC_DIR \ 13 | $$WIDGETS_PRIV_INC_DIR 14 | 15 | DEPENDPATH += \ 16 | $$BASE_INC_DIR \ 17 | $$COMMON_INC_DIR \ 18 | $$WIDGETS_PUB_INC_DIR \ 19 | $$WIDGETS_PRIV_INC_DIR 20 | 21 | HEADERS += \ 22 | $$WIDGETS_PUB_INC_DIR/framelesshelperwidgets_global.h \ 23 | $$WIDGETS_PUB_INC_DIR/framelesswidget.h \ 24 | $$WIDGETS_PUB_INC_DIR/framelessmainwindow.h \ 25 | $$WIDGETS_PUB_INC_DIR/standardsystembutton.h \ 26 | $$WIDGETS_PUB_INC_DIR/framelesswidgetshelper.h \ 27 | $$WIDGETS_PUB_INC_DIR/standardtitlebar.h \ 28 | $$WIDGETS_PUB_INC_DIR/framelessdialog.h \ 29 | $$WIDGETS_PRIV_INC_DIR/framelesswidgetshelper_p.h \ 30 | $$WIDGETS_PRIV_INC_DIR/standardsystembutton_p.h \ 31 | $$WIDGETS_PRIV_INC_DIR/standardtitlebar_p.h \ 32 | $$WIDGETS_PRIV_INC_DIR/framelesswidget_p.h \ 33 | $$WIDGETS_PRIV_INC_DIR/framelessmainwindow_p.h \ 34 | $$WIDGETS_PRIV_INC_DIR/widgetssharedhelper_p.h \ 35 | $$WIDGETS_PRIV_INC_DIR/framelessdialog_p.h 36 | 37 | SOURCES += \ 38 | $$WIDGETS_SRC_DIR/framelessmainwindow.cpp \ 39 | $$WIDGETS_SRC_DIR/framelesswidgetshelper.cpp \ 40 | $$WIDGETS_SRC_DIR/framelesswidget.cpp \ 41 | $$WIDGETS_SRC_DIR/standardsystembutton.cpp \ 42 | $$WIDGETS_SRC_DIR/standardtitlebar.cpp \ 43 | $$WIDGETS_SRC_DIR/widgetssharedhelper.cpp \ 44 | $$WIDGETS_SRC_DIR/framelesshelperwidgets_global.cpp \ 45 | $$WIDGETS_SRC_DIR/framelessdialog.cpp 46 | -------------------------------------------------------------------------------- /framelesshelper/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #[[ 2 | MIT License 3 | 4 | Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | ]] 24 | 25 | if(TARGET Qt${QT_VERSION_MAJOR}::Core AND TARGET Qt${QT_VERSION_MAJOR}::Gui) 26 | add_subdirectory(core) 27 | endif() 28 | 29 | if(FRAMELESSHELPER_BUILD_WIDGETS AND TARGET Qt${QT_VERSION_MAJOR}::Widgets) 30 | add_subdirectory(widgets) 31 | endif() 32 | 33 | if(FRAMELESSHELPER_BUILD_QUICK AND TARGET Qt${QT_VERSION_MAJOR}::Quick) 34 | add_subdirectory(quick) 35 | endif() 36 | -------------------------------------------------------------------------------- /framelesshelper/src/core/chromepalette.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/chromepalette.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/chromepalette_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/private/chromepalette_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/framelessconfig_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/private/framelessconfig_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/framelesshelper_linux.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/framelesshelper_linux.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/framelesshelper_qt.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/framelesshelper_qt.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/framelesshelper_win.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/framelesshelper_win.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/framelesshelper_windows.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/framelesshelper_windows.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/framelesshelpercore.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/fonts/iconfont.ttf 4 | resources/images/noise.png 5 | 6 | 7 | -------------------------------------------------------------------------------- /framelesshelper/src/core/framelesshelpercore_global.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/framelesshelpercore_global.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/framelesshelpercore_global_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/private/framelesshelpercore_global_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/framelessmanager.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/framelessmanager.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/framelessmanager_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/private/framelessmanager_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/micamaterial.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/micamaterial.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/micamaterial_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/private/micamaterial_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/registrykey_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/private/registrykey_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/resources/fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/framelesshelper/src/core/resources/fonts/iconfont.ttf -------------------------------------------------------------------------------- /framelesshelper/src/core/resources/images/noise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/framelesshelper/src/core/resources/images/noise.png -------------------------------------------------------------------------------- /framelesshelper/src/core/scopeguard_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/private/scopeguard_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/sysapiloader_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/private/sysapiloader_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/utils.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/utils.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/versionnumber_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/private/versionnumber_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/windowborderpainter.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/windowborderpainter.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/windowborderpainter_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/private/windowborderpainter_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/core/winverhelper_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Core/private/winverhelper_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/framelesshelperquick_global.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/framelesshelperquick_global.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/framelessquickapplicationwindow_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/private/framelessquickapplicationwindow_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/framelessquickapplicationwindow_p_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/private/framelessquickapplicationwindow_p_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/framelessquickhelper.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/framelessquickhelper.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/framelessquickhelper_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/private/framelessquickhelper_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/framelessquickmodule.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/framelessquickmodule.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/framelessquickutils.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/framelessquickutils.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/framelessquickwindow_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/private/framelessquickwindow_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/framelessquickwindow_p_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/private/framelessquickwindow_p_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/quickchromepalette.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/quickchromepalette.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/quickimageitem.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/quickimageitem.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/quickimageitem_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/private/quickimageitem_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/quickmicamaterial.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/quickmicamaterial.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/quickmicamaterial_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/private/quickmicamaterial_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/quickstandardsystembutton_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/private/quickstandardsystembutton_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/quickstandardtitlebar_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/private/quickstandardtitlebar_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/quickwindowborder.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/quickwindowborder.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/quick/quickwindowborder_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Quick/private/quickwindowborder_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/widgets/framelessdialog.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Widgets/framelessdialog.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/widgets/framelessdialog_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Widgets/private/framelessdialog_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/widgets/framelesshelperwidgets_global.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Widgets/framelesshelperwidgets_global.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/widgets/framelessmainwindow.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Widgets/framelessmainwindow.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/widgets/framelessmainwindow_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Widgets/private/framelessmainwindow_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/widgets/framelesswidget.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Widgets/framelesswidget.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/widgets/framelesswidget_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Widgets/private/framelesswidget_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/widgets/framelesswidgetshelper.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Widgets/framelesswidgetshelper.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/widgets/framelesswidgetshelper_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Widgets/private/framelesswidgetshelper_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/widgets/standardsystembutton.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Widgets/standardsystembutton.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/widgets/standardsystembutton_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Widgets/private/standardsystembutton_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/widgets/standardtitlebar.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Widgets/standardtitlebar.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/widgets/standardtitlebar_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Widgets/private/standardtitlebar_p.h" 2 | -------------------------------------------------------------------------------- /framelesshelper/src/widgets/widgetssharedhelper_p.h: -------------------------------------------------------------------------------- 1 | #include "../../include/FramelessHelper/Widgets/private/widgetssharedhelper_p.h" 2 | -------------------------------------------------------------------------------- /qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | start/Font/Segoe_Fluent_Icons.ttf 4 | start/FluAppBar.qml 5 | start/FluIcon.qml 6 | start/FluIconButton.qml 7 | start/FluToggleSwitch.qml 8 | start/MainWindow.qml 9 | start/StandardWindow.qml 10 | start/favicon.ico 11 | 12 | 13 | -------------------------------------------------------------------------------- /screenshot/Dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/screenshot/Dark.png -------------------------------------------------------------------------------- /screenshot/Light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/screenshot/Light.png -------------------------------------------------------------------------------- /src/Def.cpp: -------------------------------------------------------------------------------- 1 | #include "Def.h" 2 | -------------------------------------------------------------------------------- /src/FluApp.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUAPP_H 2 | #define FLUAPP_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "FluRegister.h" 12 | #include "FluHttpInterceptor.h" 13 | #include "stdafx.h" 14 | #include "singleton.h" 15 | 16 | /** 17 | * @brief The FluApp class 18 | */ 19 | class FluApp : public QObject 20 | { 21 | Q_OBJECT 22 | Q_PROPERTY_AUTO(bool,vsync) 23 | Q_PROPERTY_AUTO(QString,initialRoute); 24 | Q_PROPERTY_AUTO(QJsonObject,routes); 25 | Q_PROPERTY_AUTO(FluHttpInterceptor*,httpInterceptor); 26 | QML_NAMED_ELEMENT(FluApp) 27 | QML_SINGLETON 28 | private: 29 | explicit FluApp(QObject *parent = nullptr); 30 | ~FluApp(); 31 | public: 32 | SINGLETONG(FluApp) 33 | static FluApp *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return getInstance();} 34 | Q_INVOKABLE void run(); 35 | Q_INVOKABLE void navigate(const QString& route,const QJsonObject& argument = {},FluRegister* fluRegister = nullptr); 36 | Q_INVOKABLE void init(QObject *window); 37 | Q_INVOKABLE void exit(int retCode = 0); 38 | void addWindow(QQuickWindow* window); 39 | void removeWindow(QQuickWindow* window); 40 | private: 41 | QMap _windows; 42 | QObject* _application; 43 | }; 44 | 45 | #endif // FLUAPP_H 46 | -------------------------------------------------------------------------------- /src/FluCaptcha.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUCAPTCHA_H 2 | #define FLUCAPTCHA_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "stdafx.h" 8 | 9 | class FluCaptcha : public QQuickPaintedItem 10 | { 11 | Q_OBJECT 12 | Q_PROPERTY_AUTO(QFont,font); 13 | Q_PROPERTY_AUTO(bool,ignoreCase); 14 | QML_NAMED_ELEMENT(FluCaptcha) 15 | private: 16 | int _generaNumber(int number); 17 | public: 18 | explicit FluCaptcha(QQuickItem *parent = nullptr); 19 | void paint(QPainter* painter) override; 20 | Q_INVOKABLE void refresh(); 21 | Q_INVOKABLE bool verify(const QString& code); 22 | private: 23 | QString _code; 24 | }; 25 | 26 | #endif // FLUCAPTCHA_H 27 | -------------------------------------------------------------------------------- /src/FluColorSet.cpp: -------------------------------------------------------------------------------- 1 | #include "FluColorSet.h" 2 | 3 | FluColorSet::FluColorSet(QObject *parent):QObject{parent}{ 4 | } 5 | -------------------------------------------------------------------------------- /src/FluColorSet.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUCOLORSET_H 2 | #define FLUCOLORSET_H 3 | 4 | #include 5 | #include "stdafx.h" 6 | 7 | /** 8 | * @brief The FluColorSet class 9 | */ 10 | class FluColorSet : public QObject 11 | { 12 | Q_OBJECT 13 | Q_PROPERTY_AUTO(QString,darkest) 14 | Q_PROPERTY_AUTO(QString,darker) 15 | Q_PROPERTY_AUTO(QString,dark) 16 | Q_PROPERTY_AUTO(QString,normal) 17 | Q_PROPERTY_AUTO(QString,light) 18 | Q_PROPERTY_AUTO(QString,lighter) 19 | Q_PROPERTY_AUTO(QString,lightest) 20 | public: 21 | explicit FluColorSet(QObject *parent = nullptr); 22 | }; 23 | 24 | #endif // FLUCOLORSET_H 25 | -------------------------------------------------------------------------------- /src/FluEventBus.cpp: -------------------------------------------------------------------------------- 1 | #include "FluEventBus.h" 2 | 3 | FluEvent::FluEvent(QObject *parent):QObject{parent}{ 4 | } 5 | 6 | FluEventBus::FluEventBus(QObject *parent):QObject{parent}{ 7 | } 8 | 9 | void FluEventBus::registerEvent(FluEvent* event){ 10 | _eventData.append(event); 11 | } 12 | 13 | void FluEventBus::unRegisterEvent(FluEvent* event){ 14 | _eventData.removeOne(event); 15 | } 16 | 17 | void FluEventBus::post(const QString& name,const QMap& data){ 18 | foreach (auto event, _eventData) { 19 | if(event->name()==name){ 20 | Q_EMIT event->triggered(data); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/FluEventBus.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUEVENTBUS_H 2 | #define FLUEVENTBUS_H 3 | 4 | #include 5 | #include 6 | #include "stdafx.h" 7 | #include "singleton.h" 8 | 9 | class FluEvent : public QObject{ 10 | Q_OBJECT 11 | Q_PROPERTY_AUTO(QString,name); 12 | QML_NAMED_ELEMENT(FluEvent) 13 | public: 14 | explicit FluEvent(QObject *parent = nullptr); 15 | Q_SIGNAL void triggered(QMap data); 16 | }; 17 | 18 | class FluEventBus : public QObject 19 | { 20 | Q_OBJECT 21 | QML_NAMED_ELEMENT(FluEventBus) 22 | QML_SINGLETON 23 | private: 24 | explicit FluEventBus(QObject *parent = nullptr); 25 | public: 26 | SINGLETONG(FluEventBus) 27 | static FluEventBus *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return getInstance();} 28 | Q_INVOKABLE void registerEvent(FluEvent* event); 29 | Q_INVOKABLE void unRegisterEvent(FluEvent* event); 30 | Q_INVOKABLE void post(const QString& name,const QMap& params = {}); 31 | private: 32 | QList _eventData; 33 | }; 34 | 35 | #endif // FLUEVENTBUS_H 36 | -------------------------------------------------------------------------------- /src/FluHttpInterceptor.cpp: -------------------------------------------------------------------------------- 1 | #include "FluHttpInterceptor.h" 2 | 3 | FluHttpInterceptor::FluHttpInterceptor(QObject *parent):QObject{parent}{ 4 | } 5 | -------------------------------------------------------------------------------- /src/FluHttpInterceptor.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUHTTPINTERCEPTOR_H 2 | #define FLUHTTPINTERCEPTOR_H 3 | 4 | #include 5 | #include 6 | 7 | class FluHttpInterceptor : public QObject 8 | { 9 | Q_OBJECT 10 | QML_NAMED_ELEMENT(FluHttpInterceptor) 11 | public: 12 | explicit FluHttpInterceptor(QObject *parent = nullptr); 13 | }; 14 | 15 | #endif // FLUHTTPINTERCEPTOR_H 16 | -------------------------------------------------------------------------------- /src/FluRectangle.cpp: -------------------------------------------------------------------------------- 1 | #include "FluRectangle.h" 2 | #include 3 | 4 | FluRectangle::FluRectangle(QQuickItem* parent) : QQuickPaintedItem(parent){ 5 | color(QColor(255,255,255,255)); 6 | radius({0,0,0,0}); 7 | connect(this,&FluRectangle::colorChanged,this,[=]{update();}); 8 | connect(this,&FluRectangle::radiusChanged,this,[=]{update();}); 9 | } 10 | 11 | void FluRectangle::paint(QPainter* painter){ 12 | painter->save(); 13 | painter->setRenderHint(QPainter::Antialiasing); 14 | QPainterPath path; 15 | QRectF rect = boundingRect(); 16 | path.moveTo(rect.bottomRight() - QPointF(0, _radius[2])); 17 | path.lineTo(rect.topRight() + QPointF(0, _radius[1])); 18 | path.arcTo(QRectF(QPointF(rect.topRight() - QPointF(_radius[1] * 2, 0)), QSize(_radius[1] * 2, _radius[1] * 2)), 0, 90); 19 | path.lineTo(rect.topLeft() + QPointF(_radius[0], 0)); 20 | path.arcTo(QRectF(QPointF(rect.topLeft()), QSize(_radius[0] * 2, _radius[0] * 2)), 90, 90); 21 | path.lineTo(rect.bottomLeft() - QPointF(0, _radius[3])); 22 | path.arcTo(QRectF(QPointF(rect.bottomLeft() - QPointF(0, _radius[3] * 2)), QSize(_radius[3] * 2, _radius[3] * 2)), 180, 90); 23 | path.lineTo(rect.bottomRight() - QPointF(_radius[2], 0)); 24 | path.arcTo(QRectF(QPointF(rect.bottomRight() - QPointF(_radius[2] * 2, _radius[2] * 2)), QSize(_radius[2] * 2, _radius[2] * 2)), 270, 90); 25 | painter->fillPath(path,_color); 26 | painter->restore(); 27 | } 28 | -------------------------------------------------------------------------------- /src/FluRectangle.h: -------------------------------------------------------------------------------- 1 | #ifndef FLURECTANGLE_H 2 | #define FLURECTANGLE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "stdafx.h" 8 | 9 | class FluRectangle : public QQuickPaintedItem 10 | { 11 | Q_OBJECT 12 | Q_PROPERTY_AUTO(QColor,color) 13 | Q_PROPERTY_AUTO(QList,radius) 14 | QML_NAMED_ELEMENT(FluRectangle) 15 | public: 16 | explicit FluRectangle(QQuickItem *parent = nullptr); 17 | void paint(QPainter* painter) override; 18 | }; 19 | 20 | #endif // FLURECTANGLE_H 21 | -------------------------------------------------------------------------------- /src/FluRegister.cpp: -------------------------------------------------------------------------------- 1 | #include "FluRegister.h" 2 | 3 | #include "FluApp.h" 4 | #include 5 | 6 | FluRegister::FluRegister(QObject *parent):QObject{parent}{ 7 | from(nullptr); 8 | to(nullptr); 9 | path(""); 10 | } 11 | 12 | void FluRegister::launch(const QJsonObject& argument){ 13 | FluApp::getInstance()->navigate(path(),argument,this); 14 | } 15 | 16 | void FluRegister::onResult(const QJsonObject& data){ 17 | Q_EMIT result(data); 18 | } 19 | -------------------------------------------------------------------------------- /src/FluRegister.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUREGISTER_H 2 | #define FLUREGISTER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "stdafx.h" 8 | 9 | /** 10 | * @brief The FluRegister class 11 | */ 12 | class FluRegister : public QObject 13 | { 14 | Q_OBJECT 15 | Q_PROPERTY_AUTO(QQuickWindow*,from) 16 | Q_PROPERTY_AUTO(QQuickWindow*,to) 17 | Q_PROPERTY_AUTO(QString,path); 18 | public: 19 | explicit FluRegister(QObject *parent = nullptr); 20 | Q_INVOKABLE void launch(const QJsonObject& argument = {}); 21 | Q_INVOKABLE void onResult(const QJsonObject& data = {}); 22 | Q_SIGNAL void result(const QJsonObject& data); 23 | }; 24 | 25 | #endif // FLUREGISTER_H 26 | -------------------------------------------------------------------------------- /src/FluTextStyle.cpp: -------------------------------------------------------------------------------- 1 | #include "FluTextStyle.h" 2 | 3 | FluTextStyle::FluTextStyle(QObject *parent):QObject{parent}{ 4 | QFont caption; 5 | caption.setPixelSize(12); 6 | Caption(caption); 7 | 8 | QFont body; 9 | body.setPixelSize(13); 10 | Body(body); 11 | 12 | QFont bodyStrong; 13 | bodyStrong.setPixelSize(13); 14 | bodyStrong.setBold(true); 15 | BodyStrong(bodyStrong); 16 | 17 | QFont subtitle; 18 | subtitle.setPixelSize(20); 19 | subtitle.setBold(true); 20 | Subtitle(subtitle); 21 | 22 | QFont title; 23 | title.setPixelSize(28); 24 | title.setBold(true); 25 | Title(title); 26 | 27 | QFont titleLarge; 28 | titleLarge.setPixelSize(40); 29 | titleLarge.setBold(true); 30 | TitleLarge(titleLarge); 31 | 32 | QFont display; 33 | display.setPixelSize(68); 34 | display.setBold(true); 35 | Display(display); 36 | } 37 | -------------------------------------------------------------------------------- /src/FluTextStyle.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTEXTSTYLE_H 2 | #define FLUTEXTSTYLE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "stdafx.h" 8 | #include "singleton.h" 9 | 10 | class FluTextStyle : public QObject 11 | { 12 | Q_OBJECT 13 | public: 14 | Q_PROPERTY_AUTO(QFont,Caption); 15 | Q_PROPERTY_AUTO(QFont,Body); 16 | Q_PROPERTY_AUTO(QFont,BodyStrong); 17 | Q_PROPERTY_AUTO(QFont,Subtitle); 18 | Q_PROPERTY_AUTO(QFont,Title); 19 | Q_PROPERTY_AUTO(QFont,TitleLarge); 20 | Q_PROPERTY_AUTO(QFont,Display); 21 | QML_NAMED_ELEMENT(FluTextStyle) 22 | QML_SINGLETON 23 | private: 24 | explicit FluTextStyle(QObject *parent = nullptr); 25 | public: 26 | SINGLETONG(FluTextStyle) 27 | static FluTextStyle *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return getInstance();} 28 | }; 29 | 30 | #endif // FLUTEXTSTYLE_H 31 | -------------------------------------------------------------------------------- /src/FluTheme.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTHEME_H 2 | #define FLUTHEME_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "FluColorSet.h" 9 | #include "stdafx.h" 10 | #include "singleton.h" 11 | 12 | /** 13 | * @brief The FluTheme class 14 | */ 15 | class FluTheme : public QObject 16 | { 17 | Q_OBJECT 18 | Q_PROPERTY(bool dark READ dark NOTIFY darkChanged) 19 | Q_PROPERTY_AUTO(FluColorSet*,primaryColor) 20 | Q_PROPERTY_AUTO(int,darkMode); 21 | Q_PROPERTY_AUTO(bool,nativeText); 22 | Q_PROPERTY_AUTO(bool,enableAnimation); 23 | QML_NAMED_ELEMENT(FluTheme) 24 | QML_SINGLETON 25 | private: 26 | explicit FluTheme(QObject *parent = nullptr); 27 | bool eventFilter(QObject *obj, QEvent *event); 28 | bool systemDark(); 29 | public: 30 | SINGLETONG(FluTheme) 31 | Q_INVOKABLE QJsonArray awesomeList(const QString& keyword = ""); 32 | Q_SIGNAL void darkChanged(); 33 | static FluTheme *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return getInstance();} 34 | bool dark(); 35 | private: 36 | bool _dark; 37 | bool _systemDark; 38 | }; 39 | 40 | #endif // FLUTHEME_H 41 | -------------------------------------------------------------------------------- /src/FluWatermark.cpp: -------------------------------------------------------------------------------- 1 | #include "FluWatermark.h" 2 | 3 | FluWatermark::FluWatermark(QQuickItem* parent) : QQuickPaintedItem(parent){ 4 | gap(QPoint(100,100)); 5 | offset(QPoint(_gap.x()/2,_gap.y()/2)); 6 | rotate(22); 7 | setZ(9999); 8 | textColor(QColor(222,222,222,222)); 9 | textSize(16); 10 | connect(this,&FluWatermark::textColorChanged,this,[=]{update();}); 11 | connect(this,&FluWatermark::gapChanged,this,[=]{update();}); 12 | connect(this,&FluWatermark::offsetChanged,this,[=]{update();}); 13 | connect(this,&FluWatermark::textChanged,this,[=]{update();}); 14 | connect(this,&FluWatermark::rotateChanged,this,[=]{update();}); 15 | connect(this,&FluWatermark::textSizeChanged,this,[=]{update();}); 16 | } 17 | 18 | void FluWatermark::paint(QPainter* painter){ 19 | QFont font; 20 | font.setPixelSize(_textSize); 21 | painter->setFont(font); 22 | painter->setPen(_textColor); 23 | QFontMetricsF fontMetrics(font); 24 | qreal fontWidth = fontMetrics.horizontalAdvance(_text); 25 | qreal fontHeight = fontMetrics.height(); 26 | int stepX = fontWidth + _gap.x(); 27 | int stepY = fontHeight + _gap.y(); 28 | int rowCount = width() / stepX+1; 29 | int colCount = height() / stepY+1; 30 | for (int r = 0; r < rowCount; r++) 31 | { 32 | for (int c = 0; c < colCount; c++) 33 | { 34 | qreal centerX = stepX * r + _offset.x() + fontWidth / 2.0; 35 | qreal centerY = stepY * c + _offset.y() + fontHeight / 2.0; 36 | painter->save(); 37 | painter->translate(centerX, centerY); 38 | painter->rotate(_rotate); 39 | painter->drawText(QRectF(-fontWidth / 2.0, -fontHeight / 2.0, fontWidth, fontHeight), _text); 40 | painter->restore(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/FluWatermark.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUWATERMARK_H 2 | #define FLUWATERMARK_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "stdafx.h" 8 | 9 | class FluWatermark : public QQuickPaintedItem 10 | { 11 | Q_OBJECT 12 | Q_PROPERTY_AUTO(QString,text) 13 | Q_PROPERTY_AUTO(QPoint,gap) 14 | Q_PROPERTY_AUTO(QPoint,offset); 15 | Q_PROPERTY_AUTO(QColor,textColor); 16 | Q_PROPERTY_AUTO(int,rotate); 17 | Q_PROPERTY_AUTO(int,textSize); 18 | QML_NAMED_ELEMENT(FluWatermark) 19 | public: 20 | explicit FluWatermark(QQuickItem *parent = nullptr); 21 | void paint(QPainter* painter) override; 22 | 23 | }; 24 | 25 | #endif // FLUWATERMARK_H 26 | -------------------------------------------------------------------------------- /src/FluentUI.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUENTUI_H 2 | #define FLUENTUI_H 3 | 4 | #include 5 | #include 6 | #include "FluApp.h" 7 | 8 | 9 | class FluentUI : public QObject 10 | { 11 | Q_OBJECT 12 | public: 13 | static FluentUI *getInstance(); 14 | static FluApp *getFapp(); 15 | Q_DECL_EXPORT void registerTypes(QQmlEngine *engine); 16 | void registerTypes(const char *uri); 17 | void initializeEngine(QQmlEngine *engine, const char *uri); 18 | private: 19 | static FluentUI* m_instance; 20 | static FluApp* fapp; 21 | }; 22 | 23 | #endif // FLUENTUI_H 24 | -------------------------------------------------------------------------------- /src/MainThread.cpp: -------------------------------------------------------------------------------- 1 | #include "MainThread.h" 2 | #include 3 | #include 4 | 5 | std::shared_ptr MainThread::createShared(QObject* bindObject){ 6 | return std::shared_ptr(new MainThread(bindObject), [=](QObject* mainThread) { 7 | mainThread->deleteLater(); 8 | }); 9 | } 10 | 11 | MainThread::MainThread(QObject* bindObject): _bindObject(bindObject), _ignoreNullObject(bindObject == nullptr){ 12 | qRegisterMetaType>("std::function"); 13 | auto mainUIThread = qApp->thread(); 14 | if (this->thread() != mainUIThread) 15 | { 16 | this->moveToThread(mainUIThread); 17 | } 18 | } 19 | 20 | MainThread::~MainThread(){ 21 | } 22 | 23 | void MainThread::post(std::function func){ 24 | QMetaObject::invokeMethod(createShared().get(), "mainThreadSlot", Q_ARG(std::function, func)); 25 | } 26 | 27 | void MainThread::mainThreadSlot(std::function func){ 28 | if ((_ignoreNullObject || _bindObject) && func) 29 | { 30 | func(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/MainThread.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINTHREAD_H 2 | #define MAINTHREAD_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class MainThread : public QObject 9 | { 10 | Q_OBJECT 11 | public: 12 | static void post(std::function func); 13 | ~MainThread(); 14 | private: 15 | static std::shared_ptr createShared(QObject* bindObject = nullptr); 16 | private slots: 17 | void mainThreadSlot(std::function func); 18 | private: 19 | MainThread(QObject* bindObject = nullptr); 20 | QPointer _bindObject; 21 | bool _ignoreNullObject{ false }; 22 | }; 23 | #endif // MAINTHREAD_H 24 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/ColorPicker/Content/Checkerboard.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | Grid { 3 | id: root 4 | property int cellSide: 5 5 | anchors.fill: parent 6 | rows: height/cellSide; columns: width/cellSide 7 | clip: true 8 | Repeater { 9 | model: root.columns*root.rows 10 | Rectangle { 11 | width: root.cellSide; height: root.cellSide 12 | color: (index%2 == 0) ? "gray" : "white" 13 | } 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/ColorPicker/Content/ColorSlider.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | 3 | Item { 4 | property int cursorHeight: 7 5 | property real value: (1 - pickerCursor.y/height) 6 | width: 15 7 | height: 300 8 | Item { 9 | id: pickerCursor 10 | width: parent.width 11 | Rectangle { 12 | x: -3; y: -height*0.5 13 | width: parent.width + 4; height: cursorHeight 14 | border.color: "black"; border.width: 1 15 | color: "transparent" 16 | Rectangle { 17 | anchors.fill: parent; anchors.margins: 2 18 | border.color: "white"; border.width: 1 19 | color: "transparent" 20 | } 21 | } 22 | } 23 | MouseArea { 24 | y: -Math.round(cursorHeight/2) 25 | height: parent.height+cursorHeight 26 | anchors.left: parent.left 27 | preventStealing: true 28 | anchors.right: parent.right 29 | function handleMouse(mouse) { 30 | if (mouse.buttons & Qt.LeftButton) { 31 | pickerCursor.y = Math.max(0, Math.min(height, mouse.y)-cursorHeight) 32 | } 33 | } 34 | onPositionChanged:(mouse)=> { 35 | handleMouse(mouse) 36 | } 37 | onPressed:(mouse)=> handleMouse(mouse) 38 | } 39 | 40 | function setValue(val) { 41 | pickerCursor.y = height * (1 - val) 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/ColorPicker/Content/NumberBox.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | 3 | Row { 4 | property alias caption: captionBox.text 5 | property alias value: inputBox.text 6 | property alias min: numValidator.bottom 7 | property alias max: numValidator.top 8 | property alias decimals: numValidator.decimals 9 | 10 | width: 80; 11 | height: 15 12 | spacing: 4 13 | //anchors.margins: 2 14 | Text { 15 | id: captionBox 16 | width: 18; height: parent.height 17 | color: "#AAAAAA" 18 | font.pixelSize: 11; font.bold: true 19 | } 20 | PanelBorder { 21 | height: parent.height 22 | TextInput { 23 | id: inputBox 24 | color: "#AAAAAA"; selectionColor: "#FF7777AA" 25 | font.pixelSize: 11 26 | maximumLength: 10 27 | focus: false 28 | readOnly: true 29 | selectByMouse: true 30 | validator: DoubleValidator { 31 | id: numValidator 32 | bottom: 0; top: 1; decimals: 2 33 | notation: DoubleValidator.StandardNotation 34 | } 35 | } 36 | } 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/ColorPicker/Content/PanelBorder.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | 3 | Rectangle { 4 | width : 40; height : 15; radius: 2 5 | border.width: 1; border.color: "#FF101010" 6 | color: "transparent" 7 | anchors.leftMargin: 1; anchors.topMargin: 3 8 | clip: true 9 | Rectangle { 10 | anchors.fill: parent; radius: 2 11 | anchors.leftMargin: -1; anchors.topMargin: -1 12 | anchors.rightMargin: 0; anchors.bottomMargin: 0 13 | border.width: 1; border.color: "#FF525255" 14 | color: "transparent" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluAcrylic.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtGraphicalEffects 1.15 3 | import FluentUI 1.0 4 | 5 | Item { 6 | id: control 7 | property color tintColor: Qt.rgba(1,1,1,1) 8 | property real tintOpacity: 0.65 9 | property real luminosity: 0.01 10 | property real noiseOpacity : 0.066 11 | property alias target : effect_source.sourceItem 12 | property int blurRadius: 32 13 | property rect targetRect : Qt.rect(control.x, control.y, control.width, control.height) 14 | ShaderEffectSource { 15 | id: effect_source 16 | anchors.fill: parent 17 | visible: false 18 | sourceRect: control.targetRect 19 | } 20 | FastBlur { 21 | id:fast_blur 22 | anchors.fill: parent 23 | source: effect_source 24 | radius: control.blurRadius 25 | } 26 | Rectangle{ 27 | anchors.fill: parent 28 | color: Qt.rgba(1, 1, 1, luminosity) 29 | } 30 | Rectangle{ 31 | anchors.fill: parent 32 | color: Qt.rgba(tintColor.r, tintColor.g, tintColor.b, tintOpacity) 33 | } 34 | Image{ 35 | anchors.fill: parent 36 | source: "../Image/noise.png" 37 | fillMode: Image.Tile 38 | opacity: control.noiseOpacity 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluArea.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import QtQuick.Window 2.15 4 | import FluentUI 1.0 5 | 6 | Rectangle { 7 | default property alias content: container.data 8 | property int paddings : 0 9 | property int leftPadding : 0 10 | property int rightPadding : 0 11 | property int topPadding : 0 12 | property int bottomPadding : 0 13 | radius: 4 14 | color: FluTheme.dark ? Window.active ? Qt.rgba(38/255,44/255,54/255,1) : Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1) 15 | border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1) 16 | border.width: 1 17 | implicitHeight: height 18 | implicitWidth: width 19 | Item { 20 | id: container 21 | anchors.fill: parent 22 | anchors.leftMargin: Math.max(paddings,leftPadding) 23 | anchors.rightMargin: Math.max(paddings,rightPadding) 24 | anchors.topMargin: Math.max(paddings,topPadding) 25 | anchors.bottomMargin: Math.max(paddings,bottomPadding) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluClip.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import QtGraphicalEffects 1.0 4 | import FluentUI 1.0 5 | 6 | FluRectangle { 7 | id:control 8 | color: "#00000000" 9 | layer.enabled: !FluTools.isSoftware() 10 | layer.effect: OpacityMask{ 11 | maskSource: FluRectangle{ 12 | radius: control.radius 13 | width: control.width 14 | height: control.height 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluColorView.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import FluentUI 1.0 4 | import "ColorPicker" 5 | 6 | Item { 7 | id:control 8 | property alias colorValue: color_picker.colorValue 9 | property alias enableAlphaChannel: color_picker.enableAlphaChannel 10 | property int radius: 5 11 | width: color_picker.width+10 12 | height: color_picker.height 13 | FluArea{ 14 | anchors.fill: parent 15 | radius: control.radius 16 | ColorPicker{ 17 | id:color_picker 18 | } 19 | } 20 | function setColor(color) { 21 | color_picker.setColor(color) 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluControl.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import FluentUI 1.0 3 | import QtQuick.Templates 2.15 as T 4 | 5 | T.Button { 6 | id: control 7 | property string contentDescription: "" 8 | implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, 9 | implicitContentWidth + leftPadding + rightPadding) 10 | implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, 11 | implicitContentHeight + topPadding + bottomPadding) 12 | padding: 0 13 | horizontalPadding: 0 14 | spacing: 0 15 | contentItem: Item{} 16 | focusPolicy:Qt.TabFocus 17 | background: Item{ 18 | FluFocusRectangle{ 19 | visible: control.activeFocus 20 | radius:8 21 | } 22 | } 23 | Accessible.role: Accessible.Button 24 | Accessible.name: control.text 25 | Accessible.description: contentDescription 26 | Accessible.onPressAction: control.clicked() 27 | } 28 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluCopyableText.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import FluentUI 1.0 4 | 5 | TextEdit { 6 | property color textColor: FluTheme.dark ? FluColors.White : FluColors.Grey220 7 | id:control 8 | color: textColor 9 | readOnly: true 10 | activeFocusOnTab: false 11 | activeFocusOnPress: false 12 | renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering 13 | padding: 0 14 | leftPadding: 0 15 | rightPadding: 0 16 | topPadding: 0 17 | selectByMouse: true 18 | selectedTextColor: color 19 | bottomPadding: 0 20 | selectionColor: FluTools.colorAlpha(FluTheme.primaryColor.lightest,0.6) 21 | font:FluTextStyle.Body 22 | onSelectedTextChanged: { 23 | control.forceActiveFocus() 24 | } 25 | MouseArea{ 26 | anchors.fill: parent 27 | cursorShape: Qt.IBeamCursor 28 | acceptedButtons: Qt.RightButton 29 | onClicked: control.echoMode !== TextInput.Password && menu.popup() 30 | } 31 | FluTextBoxMenu{ 32 | id:menu 33 | inputItem: control 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluDivider.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Window 2.15 3 | import FluentUI 1.0 4 | 5 | Rectangle { 6 | property real spacing 7 | property alias separatorHeight:separator.height 8 | id:control 9 | color:Qt.rgba(0,0,0,0) 10 | height: spacing*2+separator.height 11 | FluRectangle{ 12 | id:separator 13 | color: FluTheme.dark ? Qt.rgba(80/255,80/255,80/255,1) : Qt.rgba(210/255,210/255,210/255,1) 14 | width:parent.width 15 | anchors.centerIn: parent 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluFocusRectangle.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import FluentUI 1.0 4 | 5 | Item { 6 | property int radius: 4 7 | id:control 8 | anchors.fill: parent 9 | Rectangle{ 10 | width: control.width 11 | height: control.height 12 | anchors.centerIn: parent 13 | color: "#00000000" 14 | border.width: 2 15 | radius: control.radius 16 | border.color: FluTheme.dark ? Qt.rgba(1,1,1,1) : Qt.rgba(0,0,0,1) 17 | z: 65535 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluIcon.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import FluentUI 1.0 4 | 5 | Text { 6 | property int iconSource 7 | property int iconSize: 20 8 | property color iconColor: FluTheme.dark ? "#FFFFFF" : "#000000" 9 | id:control 10 | font.family: "Segoe Fluent Icons" 11 | font.pixelSize: iconSize 12 | horizontalAlignment: Text.AlignHCenter 13 | verticalAlignment: Text.AlignVCenter 14 | color: iconColor 15 | text: (String.fromCharCode(iconSource).toString(16)) 16 | FontLoader{ 17 | source: "../Font/Segoe_Fluent_Icons.ttf" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluImage.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import FluentUI 1.0 4 | 5 | Image { 6 | property string errorButtonText: "重新加载" 7 | property var clickErrorListener : function(){ 8 | image.source = "" 9 | image.source = control.source 10 | } 11 | property Component errorItem : com_error 12 | property Component loadingItem: com_loading 13 | id: control 14 | Loader{ 15 | anchors.fill: parent 16 | sourceComponent: { 17 | if(control.status === Image.Loading){ 18 | return com_loading 19 | }else if(control.status == Image.Error){ 20 | return com_error 21 | }else{ 22 | return undefined 23 | } 24 | } 25 | } 26 | Component{ 27 | id:com_loading 28 | Rectangle{ 29 | color: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) 30 | FluProgressRing{ 31 | anchors.centerIn: parent 32 | visible: control.status === Image.Loading 33 | } 34 | } 35 | } 36 | Component{ 37 | id:com_error 38 | Rectangle{ 39 | color: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) 40 | FluFilledButton{ 41 | text: control.errorButtonText 42 | anchors.centerIn: parent 43 | visible: control.status === Image.Error 44 | onClicked: clickErrorListener() 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluItemDelegate.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Templates 2.15 as T 3 | import FluentUI 1.0 4 | 5 | T.ItemDelegate { 6 | id: control 7 | implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, 8 | implicitContentWidth + leftPadding + rightPadding) 9 | implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, 10 | implicitContentHeight + topPadding + bottomPadding, 11 | implicitIndicatorHeight + topPadding + bottomPadding) 12 | padding: 0 13 | verticalPadding: 8 14 | horizontalPadding: 10 15 | icon.color: control.palette.text 16 | contentItem:FluText { 17 | text: control.text 18 | font: control.font 19 | color:{ 20 | if(control.down){ 21 | return FluTheme.dark ? FluColors.Grey80 : FluColors.Grey120 22 | } 23 | return FluTheme.dark ? FluColors.White : FluColors.Grey220 24 | } 25 | } 26 | background: Rectangle { 27 | implicitWidth: 100 28 | implicitHeight: 30 29 | color:{ 30 | if(FluTheme.dark){ 31 | return Qt.rgba(1,1,1,0.05) 32 | }else{ 33 | return Qt.rgba(0,0,0,0.05) 34 | } 35 | } 36 | visible: control.down || control.highlighted || control.visualFocus 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluLoadingButton.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import FluentUI 1.0 4 | 5 | FluButton { 6 | property bool loading: false 7 | id: control 8 | disabled: loading 9 | contentItem: Row{ 10 | spacing: 6 11 | FluText { 12 | text: control.text 13 | horizontalAlignment: Text.AlignHCenter 14 | verticalAlignment: Text.AlignVCenter 15 | font: control.font 16 | color: control.textColor 17 | anchors.verticalCenter: parent.verticalCenter 18 | } 19 | Item{ 20 | width: control.loading ? 16 : 0 21 | height: 16 22 | anchors.verticalCenter: parent.verticalCenter 23 | visible: width!==0 24 | clip: true 25 | Behavior on width { 26 | enabled: FluTheme.enableAnimation 27 | NumberAnimation{ 28 | duration: 167 29 | easing.type: Easing.OutCubic 30 | } 31 | } 32 | FluProgressRing{ 33 | width: 16 34 | height: 16 35 | strokeWidth:3 36 | anchors.centerIn: parent 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluMenuBar.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Templates 2.15 as T 3 | 4 | T.MenuBar { 5 | id: control 6 | implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, 7 | contentWidth + leftPadding + rightPadding) 8 | implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, 9 | contentHeight + topPadding + bottomPadding) 10 | delegate: FluMenuBarItem { } 11 | contentItem: Row { 12 | spacing: control.spacing 13 | Repeater { 14 | model: control.contentModel 15 | } 16 | } 17 | background: Item { 18 | implicitHeight: 30 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluMenuSeparator.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Templates 2.15 as T 3 | import FluentUI 1.0 4 | 5 | T.MenuSeparator { 6 | id: control 7 | implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, 8 | implicitContentWidth + leftPadding + rightPadding) 9 | implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, 10 | implicitContentHeight + topPadding + bottomPadding) 11 | padding: 0 12 | verticalPadding: 0 13 | contentItem: Rectangle { 14 | implicitWidth: 188 15 | implicitHeight: 1 16 | color: FluTheme.dark ? Qt.rgba(60/255,60/255,60/255,1) : Qt.rgba(210/255,210/255,210/255,1) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluObject.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import FluentUI 1.0 4 | 5 | QtObject { 6 | default property list children 7 | id:control 8 | } 9 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluPage.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Layouts 1.15 3 | import QtQuick.Controls 2.15 4 | import QtQuick.Window 2.15 5 | import FluentUI 1.0 6 | 7 | Item { 8 | property int launchMode: FluPageType.SingleTop 9 | property bool animDisabled: false 10 | property string url : "" 11 | id: control 12 | opacity: visible 13 | visible: false 14 | StackView.onRemoved: destroy() 15 | Behavior on opacity{ 16 | enabled: !animDisabled && FluTheme.enableAnimation 17 | NumberAnimation{ 18 | duration: 167 19 | } 20 | } 21 | transform: Translate { 22 | y: control.visible ? 0 : 80 23 | Behavior on y{ 24 | enabled: !animDisabled && FluTheme.enableAnimation 25 | NumberAnimation{ 26 | duration: 167 27 | easing.type: Easing.OutCubic 28 | } 29 | } 30 | } 31 | Component.onCompleted: { 32 | visible = true 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluPaneItem.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import FluentUI 1.0 4 | 5 | QtObject { 6 | readonly property string key : FluTools.uuid() 7 | property int _idx 8 | property var _ext 9 | property var _parent 10 | property string title 11 | property int order : 0 12 | property var url 13 | property bool disabled: false 14 | property int icon 15 | property bool iconVisible: true 16 | property Component infoBadge 17 | property bool recentlyAdded: false 18 | property bool recentlyUpdated: false 19 | property string desc 20 | property var image 21 | property int count: 0 22 | property var onTapListener 23 | property Component iconDelegate 24 | property Component menuDelegate 25 | property Component editDelegate 26 | property bool showEdit 27 | signal tap 28 | } 29 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluPaneItemEmpty.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import FluentUI 1.0 4 | 5 | QtObject { 6 | readonly property string key : FluTools.uuid() 7 | property int _idx 8 | property var _ext 9 | property var _parent 10 | } 11 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluPaneItemExpander.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import FluentUI 1.0 4 | 5 | FluObject { 6 | readonly property string key : FluTools.uuid() 7 | property int _idx 8 | property string title 9 | property var icon 10 | property bool disabled: false 11 | property bool iconVisible: true 12 | property bool isExpand: false 13 | property bool showEdit 14 | property Component iconDelegate 15 | property Component menuDelegate 16 | property Component editDelegate 17 | } 18 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluPaneItemHeader.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import FluentUI 1.0 4 | 5 | QtObject { 6 | readonly property string key : FluTools.uuid() 7 | property int _idx 8 | property string title 9 | property var parent 10 | } 11 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluPaneItemSeparator.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import FluentUI 1.0 4 | 5 | QtObject { 6 | readonly property string key : FluTools.uuid() 7 | property int _idx 8 | property var parent 9 | property real spacing 10 | property int size:1 11 | } 12 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluPivotItem.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import FluentUI 1.0 4 | 5 | QtObject { 6 | property string title 7 | property Component contentItem 8 | property var argument 9 | } 10 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluPopup.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Layouts 1.15 3 | import QtQuick.Controls 2.15 4 | import QtQuick.Window 2.15 5 | import FluentUI 1.0 6 | 7 | Popup { 8 | id: popup 9 | padding: 0 10 | modal:true 11 | anchors.centerIn: Overlay.overlay 12 | closePolicy: Popup.CloseOnEscape 13 | enter: Transition { 14 | NumberAnimation { 15 | properties: "scale" 16 | from:1.2 17 | to:1 18 | duration: FluTheme.enableAnimation ? 83 : 0 19 | easing.type: Easing.OutCubic 20 | } 21 | NumberAnimation { 22 | property: "opacity" 23 | duration: FluTheme.enableAnimation ? 83 : 0 24 | from:0 25 | to:1 26 | } 27 | } 28 | exit:Transition { 29 | NumberAnimation { 30 | properties: "scale" 31 | from:1 32 | to:1.2 33 | duration: FluTheme.enableAnimation ? 83 : 0 34 | easing.type: Easing.OutCubic 35 | } 36 | NumberAnimation { 37 | property: "opacity" 38 | duration: FluTheme.enableAnimation ? 83 : 0 39 | from:1 40 | to:0 41 | } 42 | } 43 | background: FluRectangle{ 44 | radius: [5,5,5,5] 45 | color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluQRCode.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import FluentUI 1.0 4 | 5 | Item{ 6 | property alias text: qrcode.text 7 | property alias color: qrcode.color 8 | property alias bgColor: qrcode.bgColor 9 | property int size: 50 10 | property int margins: 0 11 | id:control 12 | width: size 13 | height: size 14 | Rectangle{ 15 | color: bgColor 16 | anchors.fill: parent 17 | } 18 | QRCode{ 19 | id:qrcode 20 | size:control.size-margins 21 | anchors.centerIn: parent 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluRadioButtons.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import QtQuick.Layouts 1.15 4 | import FluentUI 1.0 5 | 6 | ColumnLayout { 7 | default property alias buttons: control.data 8 | property int currentIndex : -1 9 | id:control 10 | onCurrentIndexChanged: { 11 | for(var i = 0;i{ 45 | d.mouseValue = Number(mouse.x / d.itemSize)+1 46 | } 47 | onExited: { 48 | d.mouseValue = 0 49 | } 50 | onClicked: (mouse)=>{ 51 | control.value = Number(mouse.x / d.itemSize)+1 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluRemoteLoader.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import FluentUI 1.0 4 | 5 | FluStatusView { 6 | property url source: "" 7 | property bool lazy: false 8 | color:"transparent" 9 | id:control 10 | onErrorClicked: { 11 | reload() 12 | } 13 | Component.onCompleted: { 14 | if(!lazy){ 15 | loader.source = control.source 16 | } 17 | } 18 | Loader{ 19 | id:loader 20 | anchors.fill: parent 21 | asynchronous: true 22 | onStatusChanged: { 23 | if(status === Loader.Error){ 24 | control.statusMode = FluStatusViewType.Error 25 | }else if(status === Loader.Loading){ 26 | control.statusMode = FluStatusViewType.Loading 27 | }else{ 28 | control.statusMode = FluStatusViewType.Success 29 | } 30 | } 31 | } 32 | function reload(){ 33 | var timestamp = Date.now(); 34 | loader.source = control.source+"?"+timestamp 35 | } 36 | function itemLodaer(){ 37 | return loader 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluScrollIndicator.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Templates 2.15 as T 3 | 4 | T.ScrollIndicator { 5 | id: control 6 | 7 | implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, 8 | implicitContentWidth + leftPadding + rightPadding) 9 | implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, 10 | implicitContentHeight + topPadding + bottomPadding) 11 | 12 | padding: 2 13 | 14 | contentItem: Rectangle { 15 | implicitWidth: 2 16 | implicitHeight: 2 17 | 18 | color: control.palette.mid 19 | visible: control.size < 1.0 20 | opacity: 0.0 21 | 22 | states: State { 23 | name: "active" 24 | when: control.active 25 | PropertyChanges { 26 | target: control 27 | contentItem.opacity: 0.75 28 | } 29 | } 30 | 31 | transitions: [ 32 | Transition { 33 | from: "active" 34 | SequentialAnimation { 35 | PauseAnimation { 36 | duration: 450 37 | } 38 | NumberAnimation { 39 | target: control.contentItem 40 | duration: 200 41 | property: "opacity" 42 | to: 0.0 43 | } 44 | } 45 | } 46 | ] 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluShadow.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import FluentUI 1.0 4 | 5 | Item { 6 | //高性能阴影!!!比DropShadow阴影性能高出数倍!!! 7 | property color color: FluTheme.dark ? "#FFFFFF" : "#999999" 8 | property int elevation: 6 9 | property int radius: 4 10 | id:control 11 | anchors.fill: parent 12 | Repeater{ 13 | model: elevation 14 | Rectangle{ 15 | anchors.fill: parent 16 | color: "#00000000" 17 | opacity: 0.01 * (elevation-index+1) 18 | anchors.margins: -index 19 | radius: control.radius+index 20 | border.width: index 21 | border.color: control.color 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluTableModelColumn.qml: -------------------------------------------------------------------------------- 1 | import Qt.labs.qmlmodels 1.0 2 | 3 | TableModelColumn{ 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluText.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import FluentUI 1.0 4 | 5 | Text { 6 | property color textColor: FluTheme.dark ? FluColors.White : FluColors.Grey220 7 | id:text 8 | color: textColor 9 | renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering 10 | font: FluTextStyle.Body 11 | } 12 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Controls/FluTooltip.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Templates 2.15 as T 3 | import FluentUI 1.0 4 | 5 | T.ToolTip { 6 | id: control 7 | x: parent ? (parent.width - implicitWidth) / 2 : 0 8 | y: -implicitHeight - 3 9 | implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, 10 | contentWidth + leftPadding + rightPadding) 11 | implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, 12 | contentHeight + topPadding + bottomPadding) 13 | margins: 6 14 | padding: 6 15 | font: FluTextStyle.Body 16 | closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent 17 | contentItem: FluText { 18 | text: control.text 19 | font: control.font 20 | wrapMode: Text.Wrap 21 | } 22 | background: Rectangle { 23 | color: FluTheme.dark ? Qt.rgba(50/255,49/255,48/255,1) : Qt.rgba(1,1,1,1) 24 | radius: 3 25 | FluShadow{ 26 | radius: 3 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Font/Segoe_Fluent_Icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/FluentUI/Font/Segoe_Fluent_Icons.ttf -------------------------------------------------------------------------------- /src/Qt5/imports/FluentUI/Image/noise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/FluentUI/Image/noise.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/app.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/app.ico -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/global/ItemsFooter.qml: -------------------------------------------------------------------------------- 1 | pragma Singleton 2 | 3 | import QtQuick 2.15 4 | import FluentUI 1.0 5 | 6 | FluObject{ 7 | 8 | property var navigationView 9 | property var paneItemMenu 10 | 11 | id:footer_items 12 | 13 | FluPaneItemSeparator{} 14 | 15 | FluPaneItem{ 16 | title:Lang.about 17 | icon:FluentIcons.Contact 18 | onTapListener:function(){ 19 | FluApp.navigate("/about") 20 | } 21 | } 22 | 23 | FluPaneItem{ 24 | title:Lang.settings 25 | menuDelegate: paneItemMenu 26 | icon:FluentIcons.Settings 27 | url:"qrc:/qt/qml/start/qml/page/T_Settings.qml" 28 | onTap:{ 29 | navigationView.push(url) 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/global/qmldir: -------------------------------------------------------------------------------- 1 | singleton ItemsOriginal 1.0 ItemsOriginal.qml 2 | singleton ItemsFooter 1.0 ItemsFooter.qml 3 | singleton Lang 1.0 Lang.qml 4 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/page/T_CalendarPicker.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import QtQuick.Layouts 1.15 4 | import QtQuick.Window 2.15 5 | import FluentUI 1.0 6 | 7 | import "../component" 8 | 9 | FluScrollablePage{ 10 | 11 | title:"CalendarPicker" 12 | 13 | FluArea{ 14 | Layout.fillWidth: true 15 | Layout.topMargin: 20 16 | height: 350 17 | paddings: 10 18 | FluCalendarView{ 19 | } 20 | } 21 | CodeExpander{ 22 | Layout.fillWidth: true 23 | Layout.topMargin: -1 24 | code:'FluCalendarView{ 25 | 26 | }' 27 | } 28 | 29 | FluArea{ 30 | Layout.fillWidth: true 31 | Layout.topMargin: 20 32 | height: 80 33 | paddings: 10 34 | ColumnLayout{ 35 | anchors{ 36 | verticalCenter: parent.verticalCenter 37 | left: parent.left 38 | } 39 | FluCalendarPicker{ 40 | current:new Date() 41 | onAccepted:{ 42 | showSuccess(current.toLocaleString()) 43 | } 44 | } 45 | } 46 | } 47 | CodeExpander{ 48 | Layout.fillWidth: true 49 | Layout.topMargin: -1 50 | code:'FluCalendarPicker{ 51 | 52 | }' 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/page/T_Captcha.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Layouts 1.15 3 | import QtQuick.Window 2.15 4 | import QtQuick.Controls 2.15 5 | import FluentUI 1.0 6 | 7 | import "../component" 8 | 9 | FluScrollablePage{ 10 | 11 | title:"Captcha" 12 | 13 | FluCaptcha{ 14 | id:captcha 15 | Layout.topMargin: 20 16 | ignoreCase:switch_case.checked 17 | MouseArea{ 18 | anchors.fill: parent 19 | cursorShape: Qt.PointingHandCursor 20 | onClicked: { 21 | captcha.refresh() 22 | } 23 | } 24 | } 25 | 26 | FluButton{ 27 | text:"Refresh" 28 | Layout.topMargin: 20 29 | onClicked: { 30 | captcha.refresh() 31 | } 32 | } 33 | 34 | FluToggleSwitch{ 35 | id:switch_case 36 | text:"Ignore Case" 37 | checked: true 38 | Layout.topMargin: 10 39 | } 40 | 41 | RowLayout{ 42 | spacing: 10 43 | Layout.topMargin: 10 44 | FluTextBox{ 45 | id:text_box 46 | placeholderText: "请输入验证码" 47 | } 48 | FluButton{ 49 | text:"verify" 50 | onClicked: { 51 | var success = captcha.verify(text_box.text) 52 | if(success){ 53 | showSuccess("验证码正确") 54 | }else{ 55 | showError("错误验证,请重新输入") 56 | } 57 | } 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/page/T_ColorPicker.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import QtQuick.Layouts 1.15 4 | import QtQuick.Window 2.15 5 | import FluentUI 1.0 6 | 7 | import "../component" 8 | 9 | FluScrollablePage{ 10 | 11 | title:"ColorPicker" 12 | 13 | FluArea{ 14 | Layout.fillWidth: true 15 | height: 280 16 | Layout.topMargin: 20 17 | paddings: 10 18 | ColumnLayout{ 19 | anchors{ 20 | verticalCenter: parent.verticalCenter 21 | left:parent.left 22 | } 23 | FluText{ 24 | text:"此颜色组件是Github上的开源项目" 25 | } 26 | FluTextButton{ 27 | text:"https://github.com/rshest/qml-colorpicker" 28 | onClicked: { 29 | Qt.openUrlExternally(text) 30 | } 31 | } 32 | FluColorView{ 33 | 34 | } 35 | } 36 | } 37 | CodeExpander{ 38 | Layout.fillWidth: true 39 | Layout.topMargin: -1 40 | code:'FluColorView{ 41 | 42 | }' 43 | } 44 | 45 | FluArea{ 46 | Layout.fillWidth: true 47 | Layout.topMargin: 20 48 | height: 60 49 | paddings: 10 50 | 51 | RowLayout{ 52 | FluText{ 53 | text:"点击选择颜色->" 54 | Layout.alignment: Qt.AlignVCenter 55 | } 56 | FluColorPicker{ 57 | 58 | } 59 | } 60 | } 61 | CodeExpander{ 62 | Layout.fillWidth: true 63 | Layout.topMargin: -1 64 | code:'FluColorPicker{ 65 | 66 | }' 67 | } 68 | 69 | } 70 | 71 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/page/T_DatePicker.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import QtQuick.Layouts 1.15 4 | import QtQuick.Window 2.15 5 | import FluentUI 1.0 6 | 7 | import "../component" 8 | 9 | FluScrollablePage{ 10 | 11 | title:"TimePicker" 12 | 13 | FluArea{ 14 | Layout.fillWidth: true 15 | Layout.topMargin: 20 16 | height: 80 17 | paddings: 10 18 | ColumnLayout{ 19 | anchors{ 20 | verticalCenter: parent.verticalCenter 21 | left: parent.left 22 | } 23 | FluText{ 24 | text:"showYear=true" 25 | } 26 | FluDatePicker{ 27 | current: new Date() 28 | onAccepted: { 29 | showSuccess(current.toLocaleDateString()) 30 | } 31 | } 32 | } 33 | } 34 | CodeExpander{ 35 | Layout.fillWidth: true 36 | Layout.topMargin: -1 37 | code:'FluDatePicker{ 38 | 39 | }' 40 | } 41 | 42 | FluArea{ 43 | Layout.fillWidth: true 44 | Layout.topMargin: 20 45 | height: 80 46 | paddings: 10 47 | ColumnLayout{ 48 | anchors{ 49 | verticalCenter: parent.verticalCenter 50 | left: parent.left 51 | } 52 | FluText{ 53 | text:"showYear=false" 54 | } 55 | FluDatePicker{ 56 | showYear:false 57 | onAccepted: { 58 | showSuccess(current.toLocaleDateString()) 59 | } 60 | } 61 | } 62 | } 63 | CodeExpander{ 64 | Layout.fillWidth: true 65 | Layout.topMargin: -1 66 | code:'FluDatePicker{ 67 | showYear:false 68 | }' 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/page/T_Image.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Layouts 1.15 3 | import QtQuick.Window 2.15 4 | import QtQuick.Controls 2.15 5 | import FluentUI 1.0 6 | 7 | import "../component" 8 | 9 | FluScrollablePage{ 10 | 11 | title:"Image" 12 | 13 | FluArea{ 14 | Layout.fillWidth: true 15 | height: 260 16 | paddings: 10 17 | Layout.topMargin: 20 18 | Column{ 19 | spacing: 15 20 | anchors{ 21 | verticalCenter: parent.verticalCenter 22 | left:parent.left 23 | } 24 | FluImage{ 25 | width: 384 26 | height: 240 27 | source: "https://gitee.com/zhu-zichu/zhu-zichu/raw/74f075efe2f8d3c3bb7ba3c2259e403450e4050b/image/banner_4.jpg" 28 | onStatusChanged:{ 29 | if(status === Image.Error){ 30 | showError("图片加载失败,请重新加载") 31 | } 32 | } 33 | clickErrorListener: function(){ 34 | source = "https://gitee.com/zhu-zichu/zhu-zichu/raw/74f075efe2f8d3c3bb7ba3c2259e403450e4050b/image/banner_1.jpg" 35 | } 36 | } 37 | } 38 | } 39 | CodeExpander{ 40 | Layout.fillWidth: true 41 | Layout.topMargin: -1 42 | code:'FluImage{ 43 | width: 400 44 | height: 300 45 | source: "https://gitee.com/zhu-zichu/zhu-zichu/raw/74f075efe2f8d3c3bb7ba3c2259e403450e4050b/image/banner_1.jpg" 46 | }' 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/page/T_Pagination.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Layouts 1.15 3 | import QtQuick.Window 2.15 4 | import QtQuick.Controls 2.15 5 | 6 | import "../component" 7 | import FluentUI 1.0 8 | 9 | FluScrollablePage{ 10 | 11 | title:"Pagination" 12 | 13 | FluArea{ 14 | Layout.fillWidth: true 15 | height: 200 16 | paddings: 10 17 | Layout.topMargin: 20 18 | ColumnLayout{ 19 | spacing: 20 20 | anchors.verticalCenter: parent.verticalCenter 21 | FluPagination{ 22 | pageCurrent: 1 23 | pageButtonCount: 5 24 | itemCount: 5000 25 | } 26 | FluPagination{ 27 | pageCurrent: 2 28 | itemCount: 5000 29 | pageButtonCount: 7 30 | } 31 | FluPagination{ 32 | pageCurrent: 3 33 | itemCount: 5000 34 | pageButtonCount: 9 35 | } 36 | } 37 | 38 | } 39 | CodeExpander{ 40 | Layout.fillWidth: true 41 | Layout.topMargin: -1 42 | code:'FluPagination{ 43 | pageCurrent: 1 44 | itemCount: 1000 45 | pageButtonCount: 9 46 | }' 47 | } 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/page/T_RatingControl.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Layouts 1.15 3 | import QtQuick.Window 2.15 4 | import QtQuick.Controls 2.15 5 | import FluentUI 1.0 6 | 7 | import "../component" 8 | 9 | FluScrollablePage { 10 | 11 | title: "RatingControl" 12 | 13 | FluArea { 14 | Layout.fillWidth: true 15 | height: 100 16 | paddings: 10 17 | Layout.topMargin: 20 18 | 19 | Column { 20 | spacing: 10 21 | anchors.verticalCenter: parent.verticalCenter 22 | FluRatingControl {} 23 | FluRatingControl { 24 | number: 10 25 | } 26 | } 27 | } 28 | 29 | CodeExpander { 30 | Layout.fillWidth: true 31 | Layout.topMargin: -1 32 | code: 'FluRatingControl{ 33 | 34 | }' 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/page/T_RemoteLoader.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Layouts 1.15 3 | import QtQuick.Window 2.15 4 | import QtQuick.Controls 2.15 5 | import FluentUI 1.0 6 | 7 | import "../component" 8 | 9 | FluPage{ 10 | launchMode: FluPageType.SingleTop 11 | FluRemoteLoader{ 12 | anchors.fill: parent 13 | source: "https://zhu-zichu.gitee.io/Qt5_T_RemoteLoader.qml" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/page/T_Screenshot.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Layouts 1.15 3 | import QtQuick.Window 2.15 4 | import QtQuick.Controls 2.15 5 | import FluentUI 1.0 6 | import Qt.labs.platform 1.0 7 | 8 | import "../component" 9 | 10 | FluScrollablePage{ 11 | 12 | title:"Screenshot" 13 | 14 | FluArea{ 15 | Layout.fillWidth: true 16 | height: 100 17 | paddings: 10 18 | Layout.topMargin: 20 19 | 20 | FluFilledButton{ 21 | anchors.verticalCenter: parent.verticalCenter 22 | text:"Open Screenshot" 23 | onClicked: { 24 | screenshot.open() 25 | } 26 | } 27 | } 28 | 29 | Rectangle{ 30 | Layout.preferredHeight: 400 31 | Layout.preferredWidth: 400 32 | Layout.topMargin: 10 33 | Layout.leftMargin: 4 34 | Layout.bottomMargin: 4 35 | radius: 4 36 | color: FluTheme.dark ? FluColors.Black : FluColors.White 37 | FluShadow{ 38 | radius: 4 39 | color: FluTheme.primaryColor.dark 40 | } 41 | Image{ 42 | id:image 43 | anchors.fill: parent 44 | fillMode: Image.PreserveAspectFit 45 | asynchronous: true 46 | } 47 | } 48 | 49 | FluScreenshot{ 50 | id:screenshot 51 | captrueMode: FluScreenshotType.File 52 | saveFolder: StandardPaths.writableLocation(StandardPaths.AppLocalDataLocation)+"/screenshot" 53 | onCaptrueCompleted: 54 | (captrue)=>{ 55 | image.source = captrue 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/page/T_Slider.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Layouts 1.15 3 | import QtQuick.Window 2.15 4 | import QtQuick.Controls 2.15 5 | 6 | import "../component" 7 | import FluentUI 1.0 8 | 9 | FluScrollablePage{ 10 | 11 | title:"Slider" 12 | 13 | FluArea{ 14 | Layout.fillWidth: true 15 | Layout.preferredHeight: 200 16 | Layout.topMargin: 20 17 | paddings: 10 18 | 19 | Row{ 20 | spacing: 30 21 | FluSlider{ 22 | } 23 | FluSlider{ 24 | orientation: Qt.Vertical 25 | anchors.verticalCenter: parent.verticalCenter 26 | } 27 | } 28 | } 29 | CodeExpander{ 30 | Layout.fillWidth: true 31 | Layout.topMargin: -1 32 | code:'FluSlider{ 33 | value:50 34 | }' 35 | } 36 | 37 | 38 | FluArea{ 39 | Layout.fillWidth: true 40 | Layout.preferredHeight: 200 41 | Layout.topMargin: 20 42 | paddings: 10 43 | Row{ 44 | spacing: 30 45 | FluRangeSlider{ 46 | } 47 | FluRangeSlider{ 48 | orientation: Qt.Vertical 49 | anchors.verticalCenter: parent.verticalCenter 50 | } 51 | } 52 | } 53 | CodeExpander{ 54 | Layout.fillWidth: true 55 | Layout.topMargin: -1 56 | code:'FluRangeSlider{ 57 | orientation: Qt.Vertical 58 | }' 59 | } 60 | } 61 | 62 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/page/T_StaggeredView.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Layouts 1.15 3 | import QtQuick.Window 2.15 4 | import QtQuick.Controls 2.15 5 | 6 | import "../component" 7 | import FluentUI 1.0 8 | 9 | FluContentPage{ 10 | 11 | title:"StaggeredView" 12 | 13 | property var colors : [FluColors.Yellow,FluColors.Orange,FluColors.Red,FluColors.Magenta,FluColors.Purple,FluColors.Blue,FluColors.Teal,FluColors.Green] 14 | 15 | 16 | ListModel{ 17 | id:list_model 18 | Component.onCompleted: { 19 | for(var i=0;i<=100;i++){ 20 | var item = {} 21 | item.color = colors[rand(0,7)].dark 22 | item.height = rand(100,300) 23 | append(item) 24 | } 25 | } 26 | 27 | } 28 | 29 | Flickable{ 30 | id: scroll 31 | anchors.fill: parent 32 | anchors.topMargin: 20 33 | boundsBehavior:Flickable.StopAtBounds 34 | contentHeight: staggered_view.implicitHeight 35 | clip: true 36 | ScrollBar.vertical: FluScrollBar {} 37 | FluStaggeredView{ 38 | id:staggered_view 39 | width: parent.width 40 | itemWidth: 160 41 | model:list_model 42 | delegate: Rectangle{ 43 | height: model.height 44 | color:model.color 45 | FluText{ 46 | color:"#FFFFFF" 47 | text:model.index 48 | font.bold: true 49 | font.pixelSize: 18 50 | anchors.centerIn: parent 51 | } 52 | } 53 | } 54 | } 55 | 56 | function rand(minNum, maxNum){ 57 | return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10); 58 | } 59 | 60 | } 61 | 62 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/page/T_Text.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import QtQuick.Layouts 1.15 4 | import QtQuick.Window 2.15 5 | import FluentUI 1.0 6 | 7 | import "../component" 8 | 9 | FluScrollablePage{ 10 | 11 | title:"Text" 12 | 13 | FluArea{ 14 | Layout.fillWidth: true 15 | Layout.topMargin: 20 16 | height: 60 17 | paddings: 10 18 | 19 | FluCopyableText{ 20 | text: "这是一个可以支持复制的Text" 21 | anchors.verticalCenter: parent.verticalCenter 22 | } 23 | 24 | } 25 | CodeExpander{ 26 | Layout.fillWidth: true 27 | Layout.topMargin: -1 28 | code:'FluCopyableText{ 29 | text:"这是一个可以支持复制的Text" 30 | }' 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/page/T_ToggleSwitch.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Layouts 1.15 3 | import QtQuick.Window 2.15 4 | import QtQuick.Controls 2.15 5 | import FluentUI 1.0 6 | 7 | import "../component" 8 | 9 | FluScrollablePage{ 10 | 11 | title:"ToggleSwitch" 12 | 13 | FluArea{ 14 | Layout.fillWidth: true 15 | height: 68 16 | paddings: 10 17 | Layout.topMargin: 20 18 | Row{ 19 | spacing: 30 20 | anchors.verticalCenter: parent.verticalCenter 21 | FluToggleSwitch{ 22 | disabled: toggle_switch.checked 23 | } 24 | FluToggleSwitch{ 25 | disabled: toggle_switch.checked 26 | text:"Right" 27 | } 28 | FluToggleSwitch{ 29 | disabled: toggle_switch.checked 30 | text:"Left" 31 | textRight: false 32 | } 33 | } 34 | FluToggleSwitch{ 35 | id:toggle_switch 36 | anchors{ 37 | right: parent.right 38 | verticalCenter: parent.verticalCenter 39 | } 40 | text:"Disabled" 41 | } 42 | } 43 | CodeExpander{ 44 | Layout.fillWidth: true 45 | Layout.topMargin: -1 46 | code:'FluToggleSwitch{ 47 | text:"Text" 48 | }' 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/viewmodel/SettingsViewModel.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import FluentUI 1.0 3 | 4 | FluViewModel{ 5 | 6 | objectName: "SettingsViewModel" 7 | scope: FluViewModelType.Application 8 | property int displayMode 9 | 10 | onInitData: { 11 | displayMode = FluNavigationViewType.Auto 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/viewmodel/TextBoxViewModel.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import FluentUI 1.0 3 | 4 | FluViewModel { 5 | objectName: "TextBoxView" 6 | property string text1 7 | property string text2 8 | } 9 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/window/LoginWindow.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Layouts 1.15 3 | import QtQuick.Controls 2.15 4 | import FluentUI 1.0 5 | 6 | import "../component" 7 | 8 | FluWindow { 9 | 10 | id:window 11 | title:"登录" 12 | width: 400 13 | height: 400 14 | fixSize: true 15 | 16 | onInitArgument: 17 | (argument)=>{ 18 | textbox_uesrname.updateText(argument.username) 19 | textbox_password.focus = true 20 | } 21 | 22 | ColumnLayout{ 23 | anchors{ 24 | left: parent.left 25 | right: parent.right 26 | verticalCenter: parent.verticalCenter 27 | } 28 | 29 | FluAutoSuggestBox{ 30 | id:textbox_uesrname 31 | items:[{title:"Admin"},{title:"User"}] 32 | placeholderText: "请输入账号" 33 | Layout.preferredWidth: 260 34 | Layout.alignment: Qt.AlignHCenter 35 | } 36 | 37 | FluTextBox{ 38 | id:textbox_password 39 | Layout.topMargin: 20 40 | Layout.preferredWidth: 260 41 | placeholderText: "请输入密码" 42 | echoMode:TextInput.Password 43 | Layout.alignment: Qt.AlignHCenter 44 | } 45 | 46 | FluFilledButton{ 47 | text:"登录" 48 | Layout.alignment: Qt.AlignHCenter 49 | Layout.topMargin: 20 50 | onClicked:{ 51 | if(textbox_password.text === ""){ 52 | showError("请随便输入一个密码") 53 | return 54 | } 55 | onResult({password:textbox_password.text}) 56 | window.close() 57 | } 58 | } 59 | 60 | } 61 | 62 | 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/window/PageWindow.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import QtQuick.Layouts 1.15 4 | import FluentUI 1.0 5 | import example 1.0 6 | 7 | import "../component" 8 | 9 | FluWindow { 10 | 11 | id:window 12 | width: 800 13 | height: 600 14 | minimumWidth: 520 15 | minimumHeight: 200 16 | launchMode: FluWindowType.SingleInstance 17 | onInitArgument: 18 | (arg)=>{ 19 | window.title = arg.title 20 | loader.setSource( arg.url,{animDisabled:true}) 21 | } 22 | Loader{ 23 | id: loader 24 | anchors.fill: parent 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/window/SingleInstanceWindow.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import QtQuick.Layouts 1.15 4 | import FluentUI 1.0 5 | 6 | import "../component" 7 | 8 | FluWindow { 9 | 10 | id:window 11 | title:"SingleInstance" 12 | width: 500 13 | height: 600 14 | fixSize: true 15 | launchMode: FluWindowType.SingleInstance 16 | 17 | FluTextBox{ 18 | anchors{ 19 | top:parent.top 20 | topMargin:60 21 | horizontalCenter: parent.horizontalCenter 22 | } 23 | } 24 | 25 | FluText{ 26 | wrapMode: Text.WrapAnywhere 27 | anchors{ 28 | left: parent.left 29 | right: parent.right 30 | leftMargin: 20 31 | rightMargin: 20 32 | verticalCenter: parent.verticalCenter 33 | } 34 | text:"我是一个SingleInstance模式的窗口,如果我存在,我会销毁之前的窗口,并创建一个新窗口" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/window/SingleTaskWindow.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import QtQuick.Layouts 1.15 4 | import FluentUI 1.0 5 | 6 | import "../component" 7 | 8 | FluWindow { 9 | 10 | id:window 11 | title:"SingleTask" 12 | width: 500 13 | height: 600 14 | fixSize: true 15 | launchMode: FluWindowType.SingleTask 16 | 17 | FluText{ 18 | anchors.centerIn: parent 19 | text:"我是一个SingleTask模式的窗口,如果我存在,我就激活窗口" 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/qml/window/StandardWindow.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import QtQuick.Layouts 1.15 4 | import FluentUI 1.0 5 | 6 | import "../component" 7 | 8 | FluWindow { 9 | 10 | id:window 11 | title:"Standard" 12 | width: 500 13 | height: 600 14 | fixSize: true 15 | launchMode: FluWindowType.Standard 16 | 17 | FluMenuBar { 18 | FluMenu { 19 | title: qsTr("File") 20 | Action { text: qsTr("New...") } 21 | Action { text: qsTr("Open...") } 22 | Action { text: qsTr("Save") } 23 | Action { text: qsTr("Save As...") } 24 | FluMenuSeparator { } 25 | Action { text: qsTr("Quit") } 26 | } 27 | FluMenu { 28 | title: qsTr("Edit") 29 | Action { text: qsTr("Cut") } 30 | Action { text: qsTr("Copy") } 31 | Action { text: qsTr("Paste") } 32 | } 33 | FluMenu { 34 | title: qsTr("Help") 35 | Action { text: qsTr("About") } 36 | } 37 | } 38 | 39 | FluText{ 40 | anchors.centerIn: parent 41 | text:"我是一个Standard模式的窗口,每次我都会创建一个新的窗口" 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/app.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/app.ico -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/banner_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/banner_1.jpg -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/banner_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/banner_2.jpg -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/banner_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/banner_3.jpg -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/bg_home_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/bg_home_header.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/bg_scenic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/bg_scenic.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/Acrylic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/Acrylic.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/AnimatedIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/AnimatedIcon.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/AnimatedVisualPlayer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/AnimatedVisualPlayer.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/AnimationInterop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/AnimationInterop.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/AppBarButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/AppBarButton.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/AppBarSeparator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/AppBarSeparator.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/AppBarToggleButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/AppBarToggleButton.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/AutoSuggestBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/AutoSuggestBox.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/AutomationProperties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/AutomationProperties.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/Border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/Border.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/BreadcrumbBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/BreadcrumbBar.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/Button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/Button.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/CalendarDatePicker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/CalendarDatePicker.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/CalendarView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/CalendarView.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/Canvas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/Canvas.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/Checkbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/Checkbox.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/Clipboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/Clipboard.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ColorPaletteResources.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ColorPaletteResources.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ColorPicker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ColorPicker.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ComboBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ComboBox.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/CommandBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/CommandBar.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/CommandBarFlyout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/CommandBarFlyout.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/CompactSizing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/CompactSizing.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ConnectedAnimation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ConnectedAnimation.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ContentDialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ContentDialog.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/CreateMultipleWindows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/CreateMultipleWindows.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/DataGrid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/DataGrid.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/DatePicker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/DatePicker.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/DropDownButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/DropDownButton.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/EasingFunction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/EasingFunction.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/Expander.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/Expander.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/FilePicker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/FilePicker.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/FlipView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/FlipView.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/Flyout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/Flyout.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/Grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/Grid.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/GridView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/GridView.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/HyperlinkButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/HyperlinkButton.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/IconElement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/IconElement.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/Image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/Image.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ImplicitTransition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ImplicitTransition.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/InfoBadge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/InfoBadge.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/InfoBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/InfoBar.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/InkCanvas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/InkCanvas.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/InkToolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/InkToolbar.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/InputValidation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/InputValidation.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ItemsRepeater.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ItemsRepeater.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/Line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/Line.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ListBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ListBox.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ListView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ListView.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/MediaPlayerElement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/MediaPlayerElement.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/MenuBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/MenuBar.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/MenuFlyout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/MenuFlyout.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/NavigationView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/NavigationView.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/NumberBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/NumberBox.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/PageTransition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/PageTransition.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ParallaxView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ParallaxView.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/PasswordBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/PasswordBox.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/PersonPicture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/PersonPicture.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/PipsPager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/PipsPager.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/Pivot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/Pivot.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ProgressBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ProgressBar.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ProgressRing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ProgressRing.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/PullToRefresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/PullToRefresh.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/RadialGradientBrush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/RadialGradientBrush.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/RadioButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/RadioButton.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/RadioButtons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/RadioButtons.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/RatingControl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/RatingControl.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/RelativePanel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/RelativePanel.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/RepeatButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/RepeatButton.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/RevealFocus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/RevealFocus.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/RichEditBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/RichEditBox.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/RichTextBlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/RichTextBlock.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ScrollViewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ScrollViewer.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/SemanticZoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/SemanticZoom.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/Shape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/Shape.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/Slider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/Slider.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/Sound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/Sound.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/SplitButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/SplitButton.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/SplitView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/SplitView.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/StackPanel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/StackPanel.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/StandardUICommand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/StandardUICommand.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/SwipeControl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/SwipeControl.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/TabView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/TabView.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/TeachingTip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/TeachingTip.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/TextBlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/TextBlock.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/TextBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/TextBox.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ThemeTransition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ThemeTransition.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/TimePicker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/TimePicker.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/TitleBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/TitleBar.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ToggleButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ToggleButton.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ToggleSplitButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ToggleSplitButton.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ToggleSwitch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ToggleSwitch.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/ToolTip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/ToolTip.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/TreeView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/TreeView.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/VariableSizedWrapGrid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/VariableSizedWrapGrid.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/Viewbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/Viewbox.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/WebView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/WebView.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/control/XamlUICommand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/control/XamlUICommand.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/favicon.ico -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/ic_home_github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/ic_home_github.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/image_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/image_1.jpg -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/logo_openai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/logo_openai.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/qrcode_adeshsingh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/qrcode_adeshsingh.png -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/qrcode_wx.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/qrcode_wx.jpg -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/image/qrcode_zfb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/src/Qt5/imports/start/res/image/qrcode_zfb.jpg -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/svg/home.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Qt5/imports/start/res/svg/home_dark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Screenshot.h: -------------------------------------------------------------------------------- 1 | #ifndef SCREENSHOT_H 2 | #define SCREENSHOT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "stdafx.h" 9 | #include 10 | 11 | class ScreenshotBackground : public QQuickPaintedItem 12 | { 13 | Q_OBJECT; 14 | QML_NAMED_ELEMENT(ScreenshotBackground) 15 | Q_PROPERTY_AUTO(QString,saveFolder); 16 | Q_PROPERTY_AUTO(int,captureMode); 17 | public: 18 | ScreenshotBackground(QQuickItem* parent = nullptr); 19 | void paint(QPainter* painter) override; 20 | Q_INVOKABLE void capture(const QPoint& start,const QPoint& end); 21 | Q_SIGNAL void captrueToPixmapCompleted(QPixmap captrue); 22 | Q_SIGNAL void captrueToFileCompleted(QUrl captrue); 23 | private: 24 | QRect _desktopGeometry; 25 | QPixmap _desktopPixmap; 26 | QPixmap _sourcePixmap; 27 | qreal _devicePixelRatio; 28 | QSharedPointer _grabResult; 29 | QRect _captureRect; 30 | }; 31 | 32 | class Screenshot : public QQuickPaintedItem 33 | { 34 | Q_OBJECT 35 | QML_NAMED_ELEMENT(Screenshot) 36 | Q_PROPERTY_AUTO(QPoint,start); 37 | Q_PROPERTY_AUTO(QPoint,end); 38 | Q_PROPERTY_AUTO(QColor,maskColor); 39 | public: 40 | Screenshot(QQuickItem* parent = nullptr); 41 | void paint(QPainter* painter) override; 42 | private: 43 | QRect _desktopGeometry; 44 | }; 45 | 46 | #endif // SCREENSHOT_H 47 | -------------------------------------------------------------------------------- /src/WindowLifecycle.cpp: -------------------------------------------------------------------------------- 1 | #include "WindowLifecycle.h" 2 | 3 | #include "FluApp.h" 4 | #include "FluRegister.h" 5 | 6 | WindowLifecycle::WindowLifecycle(QObject *parent):QObject{parent}{ 7 | } 8 | 9 | void WindowLifecycle::onCompleted(QQuickWindow* window){ 10 | this->_window = window; 11 | vsyncEnable(FluApp::getInstance()->vsync()); 12 | FluApp::getInstance()->addWindow(this->_window); 13 | } 14 | 15 | void WindowLifecycle::onDestoryOnClose(){ 16 | FluApp::getInstance()->removeWindow(this->_window); 17 | } 18 | 19 | void WindowLifecycle::onDestruction(){ 20 | } 21 | 22 | void WindowLifecycle::onVisible(bool visible){ 23 | } 24 | 25 | void WindowLifecycle::vsyncEnable(bool enable){ 26 | auto froamt = _window->format(); 27 | froamt.setSwapInterval(enable); 28 | _window->setFormat(froamt); 29 | } 30 | 31 | QVariant WindowLifecycle::createRegister(QQuickWindow* window,const QString& path){ 32 | FluRegister *p = new FluRegister(window); 33 | p->from(window); 34 | p->path(path); 35 | return QVariant::fromValue(p); 36 | } 37 | -------------------------------------------------------------------------------- /src/WindowLifecycle.h: -------------------------------------------------------------------------------- 1 | #ifndef WINDOWLIFECYCLE_H 2 | #define WINDOWLIFECYCLE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | /** 12 | * @brief The WindowLifecycle class 13 | */ 14 | class WindowLifecycle : public QObject 15 | { 16 | Q_OBJECT 17 | QML_NAMED_ELEMENT(WindowLifecycle) 18 | public: 19 | explicit WindowLifecycle(QObject *parent = nullptr); 20 | Q_INVOKABLE void onCompleted(QQuickWindow* window); 21 | Q_INVOKABLE void onDestruction(); 22 | Q_INVOKABLE void onVisible(bool visible); 23 | Q_INVOKABLE void onDestoryOnClose(); 24 | Q_INVOKABLE QVariant createRegister(QQuickWindow* window,const QString& path); 25 | void vsyncEnable(bool enable); 26 | private: 27 | QQuickWindow* _window; 28 | }; 29 | 30 | #endif // WINDOWLIFECYCLE_H 31 | -------------------------------------------------------------------------------- /src/singleton.h: -------------------------------------------------------------------------------- 1 | #ifndef SINGLETON_H 2 | #define SINGLETON_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | template 10 | class Singleton { 11 | public: 12 | static T* getInstance(); 13 | 14 | Singleton(const Singleton& other) = delete; 15 | Singleton& operator=(const Singleton& other) = delete; 16 | 17 | private: 18 | static std::mutex mutex; 19 | static T* instance; 20 | }; 21 | 22 | template 23 | std::mutex Singleton::mutex; 24 | template 25 | T* Singleton::instance; 26 | template 27 | T* Singleton::getInstance() { 28 | if (instance == nullptr) { 29 | std::lock_guard locker(mutex); 30 | if (instance == nullptr) { 31 | instance = new T(); 32 | } 33 | } 34 | return instance; 35 | } 36 | 37 | #define SINGLETONG(Class) \ 38 | private: \ 39 | friend class Singleton; \ 40 | friend struct QScopedPointerDeleter; \ 41 | \ 42 | public: \ 43 | static Class* getInstance() { \ 44 | return Singleton::getInstance(); \ 45 | } 46 | 47 | #endif // SINGLETON_H 48 | -------------------------------------------------------------------------------- /src/start/Version.h: -------------------------------------------------------------------------------- 1 | #ifndef VERSION_H 2 | #define VERSION_H 3 | 4 | #include 5 | 6 | #define APPLICATION_FULL_VERSION "1.0.0.1" 7 | #define VERSION_COUNTER 1 8 | #define COMMIT_HASH "1.0.0" 9 | #define APPLICATION_VERSION "1.0.0" 10 | 11 | #endif // VERSION_H 12 | -------------------------------------------------------------------------------- /src/start/src/AppInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "AppInfo.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include "../Version.h" 7 | 8 | AppInfo::AppInfo(QObject *parent) 9 | : QObject{parent} 10 | { 11 | version(APPLICATION_VERSION); 12 | } 13 | 14 | void AppInfo::init(QQmlApplicationEngine *engine){ 15 | engine->rootContext(); 16 | } 17 | -------------------------------------------------------------------------------- /src/start/src/AppInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef APPINFO_H 2 | #define APPINFO_H 3 | 4 | #include 5 | #include 6 | #include "stdafx.h" 7 | #include "singleton.h" 8 | 9 | class AppInfo : public QObject 10 | { 11 | Q_OBJECT 12 | Q_PROPERTY_AUTO(QString,version) 13 | private: 14 | explicit AppInfo(QObject *parent = nullptr); 15 | public: 16 | SINGLETONG(AppInfo) 17 | void init(QQmlApplicationEngine *engine); 18 | }; 19 | 20 | #endif // APPINFO_H 21 | -------------------------------------------------------------------------------- /src/start/src/component/CircularReveal.cpp: -------------------------------------------------------------------------------- 1 | #include "CircularReveal.h" 2 | #include 3 | #include 4 | #include 5 | 6 | CircularReveal::CircularReveal(QQuickItem* parent) : QQuickPaintedItem(parent) 7 | { 8 | setVisible(false); 9 | _anim->setDuration(333); 10 | _anim->setEasingCurve(QEasingCurve::OutCubic); 11 | connect(_anim, &QPropertyAnimation::finished,this,[=](){ 12 | update(); 13 | setVisible(false); 14 | Q_EMIT animationFinished(); 15 | }); 16 | connect(this,&CircularReveal::radiusChanged,this,[=](){ 17 | update(); 18 | }); 19 | } 20 | 21 | void CircularReveal::paint(QPainter* painter) 22 | { 23 | painter->save(); 24 | painter->drawImage(QRect(0, 0, static_cast(width()), static_cast(height())), _source); 25 | QPainterPath path; 26 | path.moveTo(_center.x(),_center.y()); 27 | path.addEllipse(QPointF(_center.x(),_center.y()), _radius, _radius); 28 | painter->setCompositionMode(QPainter::CompositionMode_Clear); 29 | painter->fillPath(path, Qt::black); 30 | painter->restore(); 31 | } 32 | 33 | void CircularReveal::start(int w,int h,const QPoint& center,int radius){ 34 | _anim->setStartValue(0); 35 | _anim->setEndValue(radius); 36 | _center = center; 37 | _grabResult = _target->grabToImage(QSize(w,h)); 38 | connect(_grabResult.data(), &QQuickItemGrabResult::ready, this, &CircularReveal::handleGrabResult); 39 | } 40 | 41 | void CircularReveal::handleGrabResult(){ 42 | _grabResult.data()->image().swap(_source); 43 | update(); 44 | setVisible(true); 45 | Q_EMIT imageChanged(); 46 | _anim->start(); 47 | } 48 | -------------------------------------------------------------------------------- /src/start/src/component/CircularReveal.h: -------------------------------------------------------------------------------- 1 | #ifndef CIRCULARREVEAL_H 2 | #define CIRCULARREVEAL_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "../stdafx.h" 9 | 10 | class CircularReveal : public QQuickPaintedItem 11 | { 12 | Q_OBJECT 13 | Q_PROPERTY_AUTO(QQuickItem*,target) 14 | Q_PROPERTY_AUTO(int,radius) 15 | public: 16 | CircularReveal(QQuickItem* parent = nullptr); 17 | void paint(QPainter* painter) override; 18 | Q_INVOKABLE void start(int w,int h,const QPoint& center,int radius); 19 | Q_SIGNAL void imageChanged(); 20 | Q_SIGNAL void animationFinished(); 21 | Q_SLOT void handleGrabResult(); 22 | private: 23 | QImage _source; 24 | QPropertyAnimation *_anim = new QPropertyAnimation(this, "radius", this); 25 | QPoint _center; 26 | QSharedPointer _grabResult; 27 | }; 28 | 29 | #endif // CIRCULARREVEAL_H 30 | -------------------------------------------------------------------------------- /src/start/src/component/FileWatcher.cpp: -------------------------------------------------------------------------------- 1 | #include "FileWatcher.h" 2 | 3 | FileWatcher::FileWatcher(QObject *parent) 4 | : QObject{parent} 5 | { 6 | connect(&_watcher, &QFileSystemWatcher::fileChanged, this, [=](const QString &path){ 7 | Q_EMIT fileChanged(); 8 | clean(); 9 | _watcher.addPath(_path); 10 | }); 11 | connect(this,&FileWatcher::pathChanged,this,[=](){ 12 | clean(); 13 | _watcher.addPath(_path.replace("file:///","")); 14 | }); 15 | if(!_path.isEmpty()){ 16 | _watcher.addPath(_path); 17 | } 18 | } 19 | 20 | void FileWatcher::clean(){ 21 | foreach (const QString &item, _watcher.files()) { 22 | _watcher.removePath(item); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/start/src/component/FileWatcher.h: -------------------------------------------------------------------------------- 1 | #ifndef FILEWATCHER_H 2 | #define FILEWATCHER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "../stdafx.h" 8 | 9 | class FileWatcher : public QObject 10 | { 11 | Q_OBJECT 12 | Q_PROPERTY_AUTO(QString,path); 13 | public: 14 | explicit FileWatcher(QObject *parent = nullptr); 15 | Q_SIGNAL void fileChanged(); 16 | private: 17 | void clean(); 18 | private: 19 | QFileSystemWatcher _watcher; 20 | }; 21 | 22 | #endif // FILEWATCHER_H 23 | -------------------------------------------------------------------------------- /src/start/src/component/FpsItem.cpp: -------------------------------------------------------------------------------- 1 | #include "FpsItem.h" 2 | 3 | #include 4 | #include 5 | 6 | FpsItem::FpsItem() 7 | { 8 | QTimer *timer = new QTimer(this); 9 | connect(timer, &QTimer::timeout, this, [this]{ 10 | fps(_frameCount); 11 | _frameCount = 0; 12 | }); 13 | connect(this, &QQuickItem::windowChanged, this, [this]{ 14 | if (window()){ 15 | connect(window(), &QQuickWindow::afterRendering, this, [this]{ _frameCount++; }, Qt::DirectConnection); 16 | } 17 | }); 18 | timer->start(1000); 19 | } 20 | -------------------------------------------------------------------------------- /src/start/src/component/FpsItem.h: -------------------------------------------------------------------------------- 1 | #ifndef FPSITEM_H 2 | #define FPSITEM_H 3 | 4 | #include 5 | #include "../stdafx.h" 6 | 7 | class FpsItem : public QQuickItem 8 | { 9 | Q_OBJECT 10 | Q_PROPERTY_AUTO(int,fps) 11 | public: 12 | FpsItem(); 13 | 14 | private: 15 | int _frameCount = 0; 16 | 17 | }; 18 | 19 | #endif // FPSITEM_H 20 | -------------------------------------------------------------------------------- /src/start/src/helper/SettingsHelper.cpp: -------------------------------------------------------------------------------- 1 | #include "SettingsHelper.h" 2 | 3 | #include 4 | #include 5 | 6 | SettingsHelper::SettingsHelper(QObject *parent) : QObject(parent) 7 | { 8 | 9 | } 10 | 11 | SettingsHelper::~SettingsHelper() = default; 12 | 13 | void SettingsHelper::save(const QString& key,QVariant val) 14 | { 15 | QByteArray data = {}; 16 | QDataStream stream(&data, QIODevice::WriteOnly); 17 | stream.setVersion(QDataStream::Qt_5_6); 18 | stream << val; 19 | m_settings->setValue(key, data); 20 | } 21 | 22 | QVariant SettingsHelper::get(const QString& key,QVariant def){ 23 | const QByteArray data = m_settings->value(key).toByteArray(); 24 | if (data.isEmpty()) { 25 | return def; 26 | } 27 | QDataStream stream(data); 28 | stream.setVersion(QDataStream::Qt_5_6); 29 | QVariant val; 30 | stream >> val; 31 | return val; 32 | } 33 | 34 | void SettingsHelper::init(char *argv[]){ 35 | auto applicationPath = QString::fromStdString(argv[0]); 36 | const QFileInfo fileInfo(applicationPath); 37 | const QString iniFileName = fileInfo.completeBaseName() + ".ini"; 38 | const QString iniFilePath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/" + iniFileName; 39 | qDebug()<<"Application configuration file path->"< 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "../singleton.h" 12 | 13 | class SettingsHelper : public QObject 14 | { 15 | Q_OBJECT 16 | private: 17 | explicit SettingsHelper(QObject* parent = nullptr); 18 | public: 19 | SINGLETONG(SettingsHelper) 20 | ~SettingsHelper() override; 21 | void init(char *argv[]); 22 | Q_INVOKABLE void saveRender(const QVariant& render){save("render",render);} 23 | Q_INVOKABLE QVariant getRender(){return get("render");} 24 | Q_INVOKABLE void saveDarkMode(int darkModel){save("darkMode",darkModel);} 25 | Q_INVOKABLE QVariant getDarkMode(){return get("darkMode",QVariant(0));} 26 | Q_INVOKABLE void saveVsync(bool vsync){save("vsync",vsync);} 27 | Q_INVOKABLE QVariant getVsync(){return get("vsync",QVariant(true));} 28 | private: 29 | void save(const QString& key,QVariant val); 30 | QVariant get(const QString& key,QVariant def={}); 31 | private: 32 | QScopedPointer m_settings; 33 | }; 34 | 35 | #endif // SETTINGSHELPER_H 36 | -------------------------------------------------------------------------------- /src/start/src/singleton.h: -------------------------------------------------------------------------------- 1 | #ifndef SINGLETON_H 2 | #define SINGLETON_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | template 10 | class Singleton { 11 | public: 12 | static T* getInstance(); 13 | 14 | Singleton(const Singleton& other) = delete; 15 | Singleton& operator=(const Singleton& other) = delete; 16 | 17 | private: 18 | static std::mutex mutex; 19 | static T* instance; 20 | }; 21 | 22 | template 23 | std::mutex Singleton::mutex; 24 | template 25 | T* Singleton::instance; 26 | template 27 | T* Singleton::getInstance() { 28 | if (instance == nullptr) { 29 | std::lock_guard locker(mutex); 30 | if (instance == nullptr) { 31 | instance = new T(); 32 | } 33 | } 34 | return instance; 35 | } 36 | 37 | #define SINGLETONG(Class) \ 38 | private: \ 39 | friend class Singleton; \ 40 | friend struct QScopedPointerDeleter; \ 41 | \ 42 | public: \ 43 | static Class* getInstance() { \ 44 | return Singleton::getInstance(); \ 45 | } 46 | 47 | #endif // SINGLETON_H 48 | -------------------------------------------------------------------------------- /src/start/src/stdafx.h: -------------------------------------------------------------------------------- 1 | #ifndef STDAFX_H 2 | #define STDAFX_H 3 | 4 | #define Q_PROPERTY_AUTO(TYPE, M) \ 5 | Q_PROPERTY(TYPE M MEMBER _##M NOTIFY M##Changed) \ 6 | public: \ 7 | Q_SIGNAL void M##Changed(); \ 8 | void M(TYPE in_##M) \ 9 | { \ 10 | _##M = in_##M; \ 11 | Q_EMIT M##Changed(); \ 12 | } \ 13 | TYPE M() \ 14 | { \ 15 | return _##M; \ 16 | } \ 17 | \ 18 | private: \ 19 | TYPE _##M; 20 | 21 | #endif // STDAFX_H 22 | -------------------------------------------------------------------------------- /src/stdafx.h: -------------------------------------------------------------------------------- 1 | #ifndef STDAFX_H 2 | #define STDAFX_H 3 | 4 | #define Q_PROPERTY_AUTO(TYPE, M) \ 5 | Q_PROPERTY(TYPE M MEMBER _##M NOTIFY M##Changed) \ 6 | public: \ 7 | Q_SIGNAL void M##Changed(); \ 8 | void M(TYPE in_##M) \ 9 | { \ 10 | _##M = in_##M; \ 11 | Q_EMIT M##Changed(); \ 12 | } \ 13 | TYPE M() \ 14 | { \ 15 | return _##M; \ 16 | } \ 17 | \ 18 | private: \ 19 | TYPE _##M; 20 | 21 | #endif // STDAFX_H 22 | -------------------------------------------------------------------------------- /start/FluIcon.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | 4 | Text { 5 | property int iconSource 6 | property int iconSize: 20 7 | property color iconColor: false ? "#FFFFFF" : "#000000" 8 | id:control 9 | font.family: "Segoe Fluent Icons" 10 | font.pixelSize: iconSize 11 | horizontalAlignment: Text.AlignHCenter 12 | verticalAlignment: Text.AlignVCenter 13 | color: iconColor 14 | text: (String.fromCharCode(iconSource).toString(16)) 15 | FontLoader{ 16 | source: "../start/Font/Segoe_Fluent_Icons.ttf" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /start/Font/Segoe_Fluent_Icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/start/Font/Segoe_Fluent_Icons.ttf -------------------------------------------------------------------------------- /start/StandardWindow.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.15 2 | import QtQuick.Controls 2.15 3 | import QtQuick.Layouts 1.15 4 | import org.wangwenx190.FramelessHelper 1.0 5 | 6 | MainWindow { 7 | id:window 8 | title:"Standard" 9 | width: 800 10 | height: 600 11 | fixSize: false 12 | 13 | Timer { 14 | interval: 100 15 | running: true 16 | repeat: true 17 | onTriggered: timeLabel.text = Qt.formatTime(new Date(), "hh:mm:ss") 18 | } 19 | 20 | Label { 21 | id: timeLabel 22 | anchors.centerIn: parent 23 | font { 24 | pointSize: 70 25 | bold: true 26 | } 27 | color: (FramelessUtils.systemTheme === FramelessHelperConstants.Dark) ? Qt.color("white") : Qt.color("black") 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /start/Version.h: -------------------------------------------------------------------------------- 1 | #ifndef VERSION_H 2 | #define VERSION_H 3 | 4 | #include 5 | 6 | #define APPLICATION_FULL_VERSION "1.0.0.1" 7 | #define VERSION_COUNTER 1 8 | #define COMMIT_HASH "1.0.0" 9 | #define APPLICATION_VERSION "1.0.0" 10 | 11 | #endif // VERSION_H 12 | -------------------------------------------------------------------------------- /start/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cppqtdev/frameless-window/4390871517646216a1c2b1c11bf68e0d6c19073c/start/favicon.ico -------------------------------------------------------------------------------- /start/src/AppInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "AppInfo.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include "../Version.h" 7 | 8 | AppInfo::AppInfo(QObject *parent) 9 | : QObject{parent} 10 | { 11 | version(APPLICATION_VERSION); 12 | } 13 | 14 | void AppInfo::init(QQmlApplicationEngine *engine){ 15 | engine->rootContext(); 16 | } 17 | -------------------------------------------------------------------------------- /start/src/AppInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef APPINFO_H 2 | #define APPINFO_H 3 | 4 | #include 5 | #include 6 | #include "stdafx.h" 7 | #include "singleton.h" 8 | 9 | class AppInfo : public QObject 10 | { 11 | Q_OBJECT 12 | Q_PROPERTY_AUTO(QString,version) 13 | private: 14 | explicit AppInfo(QObject *parent = nullptr); 15 | public: 16 | SINGLETONG(AppInfo) 17 | void init(QQmlApplicationEngine *engine); 18 | }; 19 | 20 | #endif // APPINFO_H 21 | -------------------------------------------------------------------------------- /start/src/Def.cpp: -------------------------------------------------------------------------------- 1 | #include "Def.h" 2 | -------------------------------------------------------------------------------- /start/src/FluTextStyle.cpp: -------------------------------------------------------------------------------- 1 | #include "FluTextStyle.h" 2 | 3 | FluTextStyle::FluTextStyle(QObject *parent):QObject{parent}{ 4 | QFont caption; 5 | caption.setPixelSize(12); 6 | Caption(caption); 7 | 8 | QFont body; 9 | body.setPixelSize(13); 10 | Body(body); 11 | 12 | QFont bodyStrong; 13 | bodyStrong.setPixelSize(13); 14 | bodyStrong.setBold(true); 15 | BodyStrong(bodyStrong); 16 | 17 | QFont subtitle; 18 | subtitle.setPixelSize(20); 19 | subtitle.setBold(true); 20 | Subtitle(subtitle); 21 | 22 | QFont title; 23 | title.setPixelSize(28); 24 | title.setBold(true); 25 | Title(title); 26 | 27 | QFont titleLarge; 28 | titleLarge.setPixelSize(40); 29 | titleLarge.setBold(true); 30 | TitleLarge(titleLarge); 31 | 32 | QFont display; 33 | display.setPixelSize(68); 34 | display.setBold(true); 35 | Display(display); 36 | } 37 | -------------------------------------------------------------------------------- /start/src/FluTextStyle.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTEXTSTYLE_H 2 | #define FLUTEXTSTYLE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "stdafx.h" 8 | #include "singleton.h" 9 | 10 | class FluTextStyle : public QObject 11 | { 12 | Q_OBJECT 13 | public: 14 | Q_PROPERTY_AUTO(QFont,Caption); 15 | Q_PROPERTY_AUTO(QFont,Body); 16 | Q_PROPERTY_AUTO(QFont,BodyStrong); 17 | Q_PROPERTY_AUTO(QFont,Subtitle); 18 | Q_PROPERTY_AUTO(QFont,Title); 19 | Q_PROPERTY_AUTO(QFont,TitleLarge); 20 | Q_PROPERTY_AUTO(QFont,Display); 21 | QML_NAMED_ELEMENT(FluTextStyle) 22 | QML_SINGLETON 23 | private: 24 | explicit FluTextStyle(QObject *parent = nullptr); 25 | public: 26 | SINGLETONG(FluTextStyle) 27 | static FluTextStyle *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return getInstance();} 28 | }; 29 | 30 | #endif // FLUTEXTSTYLE_H 31 | -------------------------------------------------------------------------------- /start/src/component/CircularReveal.cpp: -------------------------------------------------------------------------------- 1 | #include "CircularReveal.h" 2 | #include 3 | #include 4 | #include 5 | 6 | CircularReveal::CircularReveal(QQuickItem* parent) : QQuickPaintedItem(parent) 7 | { 8 | setVisible(false); 9 | _anim->setDuration(333); 10 | _anim->setEasingCurve(QEasingCurve::OutCubic); 11 | connect(_anim, &QPropertyAnimation::finished,this,[=](){ 12 | update(); 13 | setVisible(false); 14 | Q_EMIT animationFinished(); 15 | }); 16 | connect(this,&CircularReveal::radiusChanged,this,[=](){ 17 | update(); 18 | }); 19 | } 20 | 21 | void CircularReveal::paint(QPainter* painter) 22 | { 23 | painter->save(); 24 | painter->drawImage(QRect(0, 0, static_cast(width()), static_cast(height())), _source); 25 | QPainterPath path; 26 | path.moveTo(_center.x(),_center.y()); 27 | path.addEllipse(QPointF(_center.x(),_center.y()), _radius, _radius); 28 | painter->setCompositionMode(QPainter::CompositionMode_Clear); 29 | painter->fillPath(path, Qt::black); 30 | painter->restore(); 31 | } 32 | 33 | void CircularReveal::start(int w,int h,const QPoint& center,int radius){ 34 | _anim->setStartValue(0); 35 | _anim->setEndValue(radius); 36 | _center = center; 37 | _grabResult = _target->grabToImage(QSize(w,h)); 38 | connect(_grabResult.data(), &QQuickItemGrabResult::ready, this, &CircularReveal::handleGrabResult); 39 | } 40 | 41 | void CircularReveal::handleGrabResult(){ 42 | _grabResult.data()->image().swap(_source); 43 | update(); 44 | setVisible(true); 45 | Q_EMIT imageChanged(); 46 | _anim->start(); 47 | } 48 | -------------------------------------------------------------------------------- /start/src/component/CircularReveal.h: -------------------------------------------------------------------------------- 1 | #ifndef CIRCULARREVEAL_H 2 | #define CIRCULARREVEAL_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "../stdafx.h" 9 | 10 | class CircularReveal : public QQuickPaintedItem 11 | { 12 | Q_OBJECT 13 | Q_PROPERTY_AUTO(QQuickItem*,target) 14 | Q_PROPERTY_AUTO(int,radius) 15 | public: 16 | CircularReveal(QQuickItem* parent = nullptr); 17 | void paint(QPainter* painter) override; 18 | Q_INVOKABLE void start(int w,int h,const QPoint& center,int radius); 19 | Q_SIGNAL void imageChanged(); 20 | Q_SIGNAL void animationFinished(); 21 | Q_SLOT void handleGrabResult(); 22 | private: 23 | QImage _source; 24 | QPropertyAnimation *_anim = new QPropertyAnimation(this, "radius", this); 25 | QPoint _center; 26 | QSharedPointer _grabResult; 27 | }; 28 | 29 | #endif // CIRCULARREVEAL_H 30 | -------------------------------------------------------------------------------- /start/src/component/FileWatcher.cpp: -------------------------------------------------------------------------------- 1 | #include "FileWatcher.h" 2 | 3 | FileWatcher::FileWatcher(QObject *parent) 4 | : QObject{parent} 5 | { 6 | connect(&_watcher, &QFileSystemWatcher::fileChanged, this, [=](const QString &path){ 7 | Q_EMIT fileChanged(); 8 | clean(); 9 | _watcher.addPath(_path); 10 | }); 11 | connect(this,&FileWatcher::pathChanged,this,[=](){ 12 | clean(); 13 | _watcher.addPath(_path.replace("file:///","")); 14 | }); 15 | if(!_path.isEmpty()){ 16 | _watcher.addPath(_path); 17 | } 18 | } 19 | 20 | void FileWatcher::clean(){ 21 | foreach (const QString &item, _watcher.files()) { 22 | _watcher.removePath(item); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /start/src/component/FileWatcher.h: -------------------------------------------------------------------------------- 1 | #ifndef FILEWATCHER_H 2 | #define FILEWATCHER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "../stdafx.h" 8 | 9 | class FileWatcher : public QObject 10 | { 11 | Q_OBJECT 12 | Q_PROPERTY_AUTO(QString,path); 13 | public: 14 | explicit FileWatcher(QObject *parent = nullptr); 15 | Q_SIGNAL void fileChanged(); 16 | private: 17 | void clean(); 18 | private: 19 | QFileSystemWatcher _watcher; 20 | }; 21 | 22 | #endif // FILEWATCHER_H 23 | -------------------------------------------------------------------------------- /start/src/component/FpsItem.cpp: -------------------------------------------------------------------------------- 1 | #include "FpsItem.h" 2 | 3 | #include 4 | #include 5 | 6 | FpsItem::FpsItem() 7 | { 8 | QTimer *timer = new QTimer(this); 9 | connect(timer, &QTimer::timeout, this, [this]{ 10 | fps(_frameCount); 11 | _frameCount = 0; 12 | }); 13 | connect(this, &QQuickItem::windowChanged, this, [this]{ 14 | if (window()){ 15 | connect(window(), &QQuickWindow::afterRendering, this, [this]{ _frameCount++; }, Qt::DirectConnection); 16 | } 17 | }); 18 | timer->start(1000); 19 | } 20 | -------------------------------------------------------------------------------- /start/src/component/FpsItem.h: -------------------------------------------------------------------------------- 1 | #ifndef FPSITEM_H 2 | #define FPSITEM_H 3 | 4 | #include 5 | #include "../stdafx.h" 6 | 7 | class FpsItem : public QQuickItem 8 | { 9 | Q_OBJECT 10 | Q_PROPERTY_AUTO(int,fps) 11 | public: 12 | FpsItem(); 13 | 14 | private: 15 | int _frameCount = 0; 16 | 17 | }; 18 | 19 | #endif // FPSITEM_H 20 | -------------------------------------------------------------------------------- /start/src/helper/SettingsHelper.cpp: -------------------------------------------------------------------------------- 1 | #include "SettingsHelper.h" 2 | 3 | #include 4 | #include 5 | 6 | SettingsHelper::SettingsHelper(QObject *parent) : QObject(parent) 7 | { 8 | 9 | } 10 | 11 | SettingsHelper::~SettingsHelper() = default; 12 | 13 | void SettingsHelper::save(const QString& key,QVariant val) 14 | { 15 | QByteArray data = {}; 16 | QDataStream stream(&data, QIODevice::WriteOnly); 17 | stream.setVersion(QDataStream::Qt_5_6); 18 | stream << val; 19 | m_settings->setValue(key, data); 20 | } 21 | 22 | QVariant SettingsHelper::get(const QString& key,QVariant def){ 23 | const QByteArray data = m_settings->value(key).toByteArray(); 24 | if (data.isEmpty()) { 25 | return def; 26 | } 27 | QDataStream stream(data); 28 | stream.setVersion(QDataStream::Qt_5_6); 29 | QVariant val; 30 | stream >> val; 31 | return val; 32 | } 33 | 34 | void SettingsHelper::init(char *argv[]){ 35 | auto applicationPath = QString::fromStdString(argv[0]); 36 | const QFileInfo fileInfo(applicationPath); 37 | const QString iniFileName = fileInfo.completeBaseName() + ".ini"; 38 | const QString iniFilePath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/" + iniFileName; 39 | qDebug()<<"Application configuration file path->"< 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "../singleton.h" 12 | 13 | class SettingsHelper : public QObject 14 | { 15 | Q_OBJECT 16 | private: 17 | explicit SettingsHelper(QObject* parent = nullptr); 18 | public: 19 | SINGLETONG(SettingsHelper) 20 | ~SettingsHelper() override; 21 | void init(char *argv[]); 22 | Q_INVOKABLE void saveRender(const QVariant& render){save("render",render);} 23 | Q_INVOKABLE QVariant getRender(){return get("render");} 24 | Q_INVOKABLE void saveDarkMode(int darkModel){save("darkMode",darkModel);} 25 | Q_INVOKABLE QVariant getDarkMode(){return get("darkMode",QVariant(0));} 26 | Q_INVOKABLE void saveVsync(bool vsync){save("vsync",vsync);} 27 | Q_INVOKABLE QVariant getVsync(){return get("vsync",QVariant(true));} 28 | private: 29 | void save(const QString& key,QVariant val); 30 | QVariant get(const QString& key,QVariant def={}); 31 | private: 32 | QScopedPointer m_settings; 33 | }; 34 | 35 | #endif // SETTINGSHELPER_H 36 | -------------------------------------------------------------------------------- /start/src/singleton.h: -------------------------------------------------------------------------------- 1 | #ifndef SINGLETON_H 2 | #define SINGLETON_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | template 10 | class Singleton { 11 | public: 12 | static T* getInstance(); 13 | 14 | Singleton(const Singleton& other) = delete; 15 | Singleton& operator=(const Singleton& other) = delete; 16 | 17 | private: 18 | static std::mutex mutex; 19 | static T* instance; 20 | }; 21 | 22 | template 23 | std::mutex Singleton::mutex; 24 | template 25 | T* Singleton::instance; 26 | template 27 | T* Singleton::getInstance() { 28 | if (instance == nullptr) { 29 | std::lock_guard locker(mutex); 30 | if (instance == nullptr) { 31 | instance = new T(); 32 | } 33 | } 34 | return instance; 35 | } 36 | 37 | #define SINGLETONG(Class) \ 38 | private: \ 39 | friend class Singleton; \ 40 | friend struct QScopedPointerDeleter; \ 41 | \ 42 | public: \ 43 | static Class* getInstance() { \ 44 | return Singleton::getInstance(); \ 45 | } 46 | 47 | #endif // SINGLETON_H 48 | -------------------------------------------------------------------------------- /start/src/stdafx.h: -------------------------------------------------------------------------------- 1 | #ifndef STDAFX_H 2 | #define STDAFX_H 3 | 4 | #define Q_PROPERTY_AUTO(TYPE, M) \ 5 | Q_PROPERTY(TYPE M MEMBER _##M NOTIFY M##Changed) \ 6 | public: \ 7 | Q_SIGNAL void M##Changed(); \ 8 | void M(TYPE in_##M) \ 9 | { \ 10 | _##M = in_##M; \ 11 | Q_EMIT M##Changed(); \ 12 | } \ 13 | TYPE M() \ 14 | { \ 15 | return _##M; \ 16 | } \ 17 | \ 18 | private: \ 19 | TYPE _##M; 20 | 21 | #endif // STDAFX_H 22 | --------------------------------------------------------------------------------