From a025d5d612f5c8c0df9655876caaac34ad99b575 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 01:23:27 +0100 Subject: [PATCH 01/46] Start using cmake instead of qmake. --- .gitignore | 1 + CMakeLists.txt | 64 +++++++++++++ components/CMakeLists.txt | 185 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 250 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 components/CMakeLists.txt diff --git a/.gitignore b/.gitignore index 75c107bcc..1dcdf89fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.pro.user +CMakeLists.txt.user diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..c7aef909b --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,64 @@ +cmake_minimum_required(VERSION 3.5) + +project(QtMaterialWidgets VERSION 0.1 LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core5Compat REQUIRED) + +add_subdirectory(components) + +set(PROJECT_SOURCES + +) + +if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) + qt_add_executable(QtMaterialWidgets + MANUAL_FINALIZATION + ${PROJECT_SOURCES} + ) +# Define target properties for Android with Qt 6 as: +# set_property(TARGET QtMaterialWidgets APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR +# ${CMAKE_CURRENT_SOURCE_DIR}/android) +# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation +else() + if(ANDROID) + add_library(QtMaterialWidgets SHARED + ${PROJECT_SOURCES} + ) +# Define properties for Android with Qt 5 after find_package() calls as: +# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android") + else() + add_executable(QtMaterialWidgets + ${PROJECT_SOURCES} + ) + endif() +endif() + +target_link_libraries(QtMaterialWidgets PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) +target_link_libraries(QtMaterialWidgets PRIVATE Qt${QT_VERSION_MAJOR}::Core) +target_link_libraries(QtMaterialWidgets PRIVATE Qt${QT_VERSION_MAJOR}::Core5Compat) + +set_target_properties(QtMaterialWidgets PROPERTIES + MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com + MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} + MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} + MACOSX_BUNDLE TRUE + WIN32_EXECUTABLE TRUE +) + +#file(COPY assets DESTINATION ${CMAKE_BINARY_DIR}) + +if(QT_VERSION_MAJOR EQUAL 6) + qt_finalize_executable(QtMaterialWidgets) +endif() diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt new file mode 100644 index 000000000..a5b77b0d6 --- /dev/null +++ b/components/CMakeLists.txt @@ -0,0 +1,185 @@ +cmake_minimum_required(VERSION 3.5) + +project(components VERSION 0.1 LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core5Compat REQUIRED) + +set(PROJECT_SOURCES + qtmaterialavatar.cpp + lib/qtmaterialstyle.cpp + lib/qtmaterialtheme.cpp + qtmaterialbadge.cpp + lib/qtmaterialoverlaywidget.cpp + qtmaterialcheckbox.cpp + lib/qtmaterialcheckable_internal.cpp + lib/qtmaterialcheckable.cpp + lib/qtmaterialripple.cpp + lib/qtmaterialrippleoverlay.cpp + qtmaterialfab.cpp + qtmaterialraisedbutton.cpp + qtmaterialflatbutton_internal.cpp + qtmaterialflatbutton.cpp + lib/qtmaterialstatetransition.cpp + qtmaterialiconbutton.cpp + qtmaterialprogress_internal.cpp + qtmaterialprogress.cpp + qtmaterialcircularprogress_internal.cpp + qtmaterialcircularprogress.cpp + qtmaterialslider_internal.cpp + qtmaterialslider.cpp + qtmaterialsnackbar_internal.cpp + qtmaterialsnackbar.cpp + qtmaterialradiobutton.cpp + qtmaterialtoggle_internal.cpp + qtmaterialtoggle.cpp + qtmaterialtextfield_internal.cpp + qtmaterialtextfield.cpp + qtmaterialtabs_internal.cpp + qtmaterialtabs.cpp + qtmaterialscrollbar_internal.cpp + qtmaterialscrollbar.cpp + qtmaterialdialog_internal.cpp + qtmaterialdialog.cpp + qtmaterialdrawer_internal.cpp + qtmaterialdrawer.cpp + qtmaterialappbar.cpp + qtmaterialautocomplete.cpp + qtmaterialpaper.cpp + qtmaterialtable.cpp + layouts/qtmaterialsnackbarlayout.cpp + qtmaterialautocomplete_internal.cpp + qtmaterialmenu.cpp + qtmaterialmenu_internal.cpp + qtmateriallist.cpp + qtmateriallistitem.cpp + qtmaterialavatar_p.h + qtmaterialavatar.h + lib/qtmaterialstyle_p.h + lib/qtmaterialstyle.h + lib/qtmaterialtheme_p.h + lib/qtmaterialtheme.h + qtmaterialbadge_p.h + qtmaterialbadge.h + lib/qtmaterialoverlaywidget.h + qtmaterialcheckbox_p.h + qtmaterialcheckbox.h + lib/qtmaterialcheckable_internal.h + lib/qtmaterialcheckable_p.h + lib/qtmaterialripple.h + lib/qtmaterialrippleoverlay.h + lib/qtmaterialcheckable.h + qtmaterialfab_p.h + qtmaterialfab.h + qtmaterialraisedbutton_p.h + qtmaterialraisedbutton.h + qtmaterialflatbutton_internal.h + qtmaterialflatbutton_p.h + qtmaterialflatbutton.h + lib/qtmaterialstatetransition.h + lib/qtmaterialstatetransitionevent.h + qtmaterialiconbutton_p.h + qtmaterialiconbutton.h + qtmaterialprogress_internal.h + qtmaterialprogress_p.h + qtmaterialprogress.h + qtmaterialcircularprogress_internal.h + qtmaterialcircularprogress_p.h + qtmaterialcircularprogress.h + qtmaterialslider_internal.h + qtmaterialslider_p.h + qtmaterialslider.h + qtmaterialsnackbar_internal.h + qtmaterialsnackbar_p.h + qtmaterialsnackbar.h + qtmaterialradiobutton_p.h + qtmaterialradiobutton.h + qtmaterialtoggle_internal.h + qtmaterialtoggle_p.h + qtmaterialtoggle.h + qtmaterialtextfield_internal.h + qtmaterialtextfield_p.h + qtmaterialtextfield.h + qtmaterialtabs_internal.h + qtmaterialtabs_p.h + qtmaterialtabs.h + qtmaterialscrollbar_internal.h + qtmaterialscrollbar_p.h + qtmaterialscrollbar.h + qtmaterialdialog_internal.h + qtmaterialdialog_p.h + qtmaterialdialog.h + qtmaterialdrawer_internal.h + qtmaterialdrawer_p.h + qtmaterialdrawer.h + qtmaterialappbar.h + qtmaterialappbar_p.h + qtmaterialautocomplete.h + qtmaterialautocomplete_p.h + qtmaterialpaper.h + qtmaterialpaper_p.h + qtmaterialtable.h + qtmaterialtable_p.h + layouts/qtmaterialsnackbarlayout.h + layouts/qtmaterialsnackbarlayout_p.h + qtmaterialautocomplete_internal.h + qtmaterialmenu.h + qtmaterialmenu_p.h + qtmaterialmenu_internal.h + qtmateriallist.h + qtmateriallist_p.h + qtmateriallistitem.h + qtmateriallistitem_p.h +) + +if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) + qt_add_executable(components + MANUAL_FINALIZATION + ${PROJECT_SOURCES} + ) +# Define target properties for Android with Qt 6 as: +# set_property(TARGET components APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR +# ${CMAKE_CURRENT_SOURCE_DIR}/android) +# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation +else() + if(ANDROID) + add_library(components SHARED + ${PROJECT_SOURCES} + ) +# Define properties for Android with Qt 5 after find_package() calls as: +# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android") + else() + add_executable(components + ${PROJECT_SOURCES} + ) + endif() +endif() + +target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) +target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::Core) +target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::Core5Compat) + +set_target_properties(components PROPERTIES + MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com + MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} + MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} + MACOSX_BUNDLE TRUE + WIN32_EXECUTABLE TRUE +) + +file(COPY icons DESTINATION ${CMAKE_BINARY_DIR}) + +if(QT_VERSION_MAJOR EQUAL 6) + qt_finalize_executable(components) +endif() From c667bc2299ecb3a35ecb52fda5055b1eccacd0a8 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 01:25:43 +0100 Subject: [PATCH 02/46] removing *.qrc files. --- components/resources.qrc | 972 --------------------------------------- 1 file changed, 972 deletions(-) delete mode 100644 components/resources.qrc diff --git a/components/resources.qrc b/components/resources.qrc deleted file mode 100644 index 605bd1a05..000000000 --- a/components/resources.qrc +++ /dev/null @@ -1,972 +0,0 @@ - - - ../fonts/Roboto/Roboto-Black.ttf - ../fonts/Roboto/Roboto-Bold.ttf - ../fonts/Roboto/Roboto-Medium.ttf - ../fonts/Roboto/Roboto-Regular.ttf - ../fonts/Roboto/Roboto-Light.ttf - ../fonts/Roboto/Roboto-Thin.ttf - - - icons/communication/svg/production/ic_message_24px.svg - icons/toggle/svg/production/ic_check_box_24px.svg - icons/toggle/svg/production/ic_check_box_outline_blank_24px.svg - icons/toggle/svg/production/ic_indeterminate_check_box_24px.svg - icons/toggle/svg/production/ic_radio_button_checked_24px.svg - icons/toggle/svg/production/ic_radio_button_unchecked_24px.svg - icons/toggle/svg/production/ic_star_24px.svg - icons/toggle/svg/production/ic_star_border_24px.svg - icons/toggle/svg/production/ic_star_half_24px.svg - icons/communication/svg/production/ic_business_24px.svg - icons/communication/svg/production/ic_call_24px.svg - icons/communication/svg/production/ic_call_end_24px.svg - icons/communication/svg/production/ic_call_made_24px.svg - icons/communication/svg/production/ic_call_merge_24px.svg - icons/communication/svg/production/ic_call_missed_24px.svg - icons/communication/svg/production/ic_call_missed_outgoing_24px.svg - icons/communication/svg/production/ic_call_received_24px.svg - icons/communication/svg/production/ic_call_split_24px.svg - icons/communication/svg/production/ic_chat_24px.svg - icons/communication/svg/production/ic_chat_bubble_24px.svg - icons/communication/svg/production/ic_chat_bubble_outline_24px.svg - icons/communication/svg/production/ic_clear_all_24px.svg - icons/communication/svg/production/ic_comment_24px.svg - icons/communication/svg/production/ic_contact_mail_24px.svg - icons/communication/svg/production/ic_contact_phone_24px.svg - icons/communication/svg/production/ic_contacts_24px.svg - icons/communication/svg/production/ic_dialer_sip_24px.svg - icons/communication/svg/production/ic_dialpad_24px.svg - icons/communication/svg/production/ic_email_24px.svg - icons/communication/svg/production/ic_forum_24px.svg - icons/communication/svg/production/ic_import_contacts_24px.svg - icons/communication/svg/production/ic_import_export_24px.svg - icons/communication/svg/production/ic_invert_colors_off_24px.svg - icons/communication/svg/production/ic_live_help_24px.svg - icons/communication/svg/production/ic_location_off_24px.svg - icons/communication/svg/production/ic_location_on_24px.svg - icons/communication/svg/production/ic_mail_outline_24px.svg - icons/communication/svg/production/ic_no_sim_24px.svg - icons/communication/svg/production/ic_phone_24px.svg - icons/communication/svg/production/ic_phonelink_erase_24px.svg - icons/communication/svg/production/ic_phonelink_lock_24px.svg - icons/communication/svg/production/ic_phonelink_ring_24px.svg - icons/communication/svg/production/ic_phonelink_setup_24px.svg - icons/communication/svg/production/ic_portable_wifi_off_24px.svg - icons/communication/svg/production/ic_present_to_all_24px.svg - icons/communication/svg/production/ic_ring_volume_24px.svg - icons/communication/svg/production/ic_rss_feed_24px.svg - icons/communication/svg/production/ic_screen_share_24px.svg - icons/communication/svg/production/ic_speaker_phone_24px.svg - icons/communication/svg/production/ic_stay_current_landscape_24px.svg - icons/communication/svg/production/ic_stay_current_portrait_24px.svg - icons/communication/svg/production/ic_stay_primary_landscape_24px.svg - icons/communication/svg/production/ic_stay_primary_portrait_24px.svg - icons/communication/svg/production/ic_stop_screen_share_24px.svg - icons/communication/svg/production/ic_swap_calls_24px.svg - icons/communication/svg/production/ic_textsms_24px.svg - icons/communication/svg/production/ic_voicemail_24px.svg - icons/communication/svg/production/ic_vpn_key_24px.svg - icons/action/svg/production/ic_3d_rotation_24px.svg - icons/action/svg/production/ic_accessibility_24px.svg - icons/action/svg/production/ic_accessible_24px.svg - icons/action/svg/production/ic_account_balance_24px.svg - icons/action/svg/production/ic_account_balance_wallet_24px.svg - icons/action/svg/production/ic_account_box_24px.svg - icons/action/svg/production/ic_account_circle_24px.svg - icons/action/svg/production/ic_add_shopping_cart_24px.svg - icons/action/svg/production/ic_alarm_24px.svg - icons/action/svg/production/ic_alarm_add_24px.svg - icons/action/svg/production/ic_alarm_off_24px.svg - icons/action/svg/production/ic_alarm_on_24px.svg - icons/action/svg/production/ic_all_out_24px.svg - icons/action/svg/production/ic_android_24px.svg - icons/action/svg/production/ic_announcement_24px.svg - icons/action/svg/production/ic_aspect_ratio_24px.svg - icons/action/svg/production/ic_assessment_24px.svg - icons/action/svg/production/ic_assignment_24px.svg - icons/action/svg/production/ic_assignment_ind_24px.svg - icons/action/svg/production/ic_assignment_late_24px.svg - icons/action/svg/production/ic_assignment_return_24px.svg - icons/action/svg/production/ic_assignment_returned_24px.svg - icons/action/svg/production/ic_assignment_turned_in_24px.svg - icons/action/svg/production/ic_autorenew_24px.svg - icons/action/svg/production/ic_backup_24px.svg - icons/action/svg/production/ic_book_24px.svg - icons/action/svg/production/ic_bookmark_24px.svg - icons/action/svg/production/ic_bookmark_border_24px.svg - icons/action/svg/production/ic_bug_report_24px.svg - icons/action/svg/production/ic_build_24px.svg - icons/action/svg/production/ic_cached_24px.svg - icons/action/svg/production/ic_camera_enhance_24px.svg - icons/action/svg/production/ic_card_giftcard_24px.svg - icons/action/svg/production/ic_card_membership_24px.svg - icons/action/svg/production/ic_card_travel_24px.svg - icons/action/svg/production/ic_change_history_24px.svg - icons/action/svg/production/ic_check_circle_24px.svg - icons/action/svg/production/ic_chrome_reader_mode_24px.svg - icons/action/svg/production/ic_class_24px.svg - icons/action/svg/production/ic_code_24px.svg - icons/action/svg/production/ic_compare_arrows_24px.svg - icons/action/svg/production/ic_copyright_24px.svg - icons/action/svg/production/ic_credit_card_24px.svg - icons/action/svg/production/ic_dashboard_24px.svg - icons/action/svg/production/ic_date_range_24px.svg - icons/action/svg/production/ic_delete_24px.svg - icons/action/svg/production/ic_delete_forever_24px.svg - icons/action/svg/production/ic_description_24px.svg - icons/action/svg/production/ic_dns_24px.svg - icons/action/svg/production/ic_done_24px.svg - icons/action/svg/production/ic_done_all_24px.svg - icons/action/svg/production/ic_donut_large_24px.svg - icons/action/svg/production/ic_donut_small_24px.svg - icons/action/svg/production/ic_eject_24px.svg - icons/action/svg/production/ic_euro_symbol_24px.svg - icons/action/svg/production/ic_event_24px.svg - icons/action/svg/production/ic_event_seat_24px.svg - icons/action/svg/production/ic_exit_to_app_24px.svg - icons/action/svg/production/ic_explore_24px.svg - icons/action/svg/production/ic_extension_24px.svg - icons/action/svg/production/ic_face_24px.svg - icons/action/svg/production/ic_favorite_24px.svg - icons/action/svg/production/ic_favorite_border_24px.svg - icons/action/svg/production/ic_feedback_24px.svg - icons/action/svg/production/ic_find_in_page_24px.svg - icons/action/svg/production/ic_find_replace_24px.svg - icons/action/svg/production/ic_fingerprint_24px.svg - icons/action/svg/production/ic_flight_land_24px.svg - icons/action/svg/production/ic_flight_takeoff_24px.svg - icons/action/svg/production/ic_flip_to_back_24px.svg - icons/action/svg/production/ic_flip_to_front_24px.svg - icons/action/svg/production/ic_g_translate_24px.svg - icons/action/svg/production/ic_gavel_24px.svg - icons/action/svg/production/ic_get_app_24px.svg - icons/action/svg/production/ic_gif_24px.svg - icons/action/svg/production/ic_grade_24px.svg - icons/action/svg/production/ic_group_work_24px.svg - icons/action/svg/production/ic_help_24px.svg - icons/action/svg/production/ic_help_outline_24px.svg - icons/action/svg/production/ic_highlight_off_24px.svg - icons/action/svg/production/ic_history_24px.svg - icons/action/svg/production/ic_home_24px.svg - icons/action/svg/production/ic_hourglass_empty_24px.svg - icons/action/svg/production/ic_hourglass_full_24px.svg - icons/action/svg/production/ic_http_24px.svg - icons/action/svg/production/ic_https_24px.svg - icons/action/svg/production/ic_important_devices_24px.svg - icons/action/svg/production/ic_info_24px.svg - icons/action/svg/production/ic_info_outline_24px.svg - icons/action/svg/production/ic_input_24px.svg - icons/action/svg/production/ic_invert_colors_24px.svg - icons/action/svg/production/ic_label_24px.svg - icons/action/svg/production/ic_label_outline_24px.svg - icons/action/svg/production/ic_language_24px.svg - icons/action/svg/production/ic_launch_24px.svg - icons/action/svg/production/ic_lightbulb_outline_24px.svg - icons/action/svg/production/ic_line_style_24px.svg - icons/action/svg/production/ic_line_weight_24px.svg - icons/action/svg/production/ic_list_24px.svg - icons/action/svg/production/ic_lock_24px.svg - icons/action/svg/production/ic_lock_open_24px.svg - icons/action/svg/production/ic_lock_outline_24px.svg - icons/action/svg/production/ic_loyalty_24px.svg - icons/action/svg/production/ic_markunread_mailbox_24px.svg - icons/action/svg/production/ic_motorcycle_24px.svg - icons/action/svg/production/ic_note_add_24px.svg - icons/action/svg/production/ic_offline_pin_24px.svg - icons/action/svg/production/ic_opacity_24px.svg - icons/action/svg/production/ic_open_in_browser_24px.svg - icons/action/svg/production/ic_open_in_new_24px.svg - icons/action/svg/production/ic_open_with_24px.svg - icons/action/svg/production/ic_pageview_24px.svg - icons/action/svg/production/ic_pan_tool_24px.svg - icons/action/svg/production/ic_payment_24px.svg - icons/action/svg/production/ic_perm_camera_mic_24px.svg - icons/action/svg/production/ic_perm_contact_calendar_24px.svg - icons/action/svg/production/ic_perm_data_setting_24px.svg - icons/action/svg/production/ic_perm_device_information_24px.svg - icons/action/svg/production/ic_perm_identity_24px.svg - icons/action/svg/production/ic_perm_media_24px.svg - icons/action/svg/production/ic_perm_phone_msg_24px.svg - icons/action/svg/production/ic_perm_scan_wifi_24px.svg - icons/action/svg/production/ic_pets_24px.svg - icons/action/svg/production/ic_picture_in_picture_24px.svg - icons/action/svg/production/ic_picture_in_picture_alt_24px.svg - icons/action/svg/production/ic_play_for_work_24px.svg - icons/action/svg/production/ic_polymer_24px.svg - icons/action/svg/production/ic_power_settings_new_24px.svg - icons/action/svg/production/ic_pregnant_woman_24px.svg - icons/action/svg/production/ic_print_24px.svg - icons/action/svg/production/ic_query_builder_24px.svg - icons/action/svg/production/ic_question_answer_24px.svg - icons/action/svg/production/ic_receipt_24px.svg - icons/action/svg/production/ic_record_voice_over_24px.svg - icons/action/svg/production/ic_redeem_24px.svg - icons/action/svg/production/ic_remove_shopping_cart_24px.svg - icons/action/svg/production/ic_reorder_24px.svg - icons/action/svg/production/ic_report_problem_24px.svg - icons/action/svg/production/ic_restore_24px.svg - icons/action/svg/production/ic_restore_page_24px.svg - icons/action/svg/production/ic_room_24px.svg - icons/action/svg/production/ic_rounded_corner_24px.svg - icons/action/svg/production/ic_rowing_24px.svg - icons/action/svg/production/ic_schedule_24px.svg - icons/action/svg/production/ic_search_24px.svg - icons/action/svg/production/ic_settings_24px.svg - icons/action/svg/production/ic_settings_applications_24px.svg - icons/action/svg/production/ic_settings_backup_restore_24px.svg - icons/action/svg/production/ic_settings_bluetooth_24px.svg - icons/action/svg/production/ic_settings_brightness_24px.svg - icons/action/svg/production/ic_settings_cell_24px.svg - icons/action/svg/production/ic_settings_ethernet_24px.svg - icons/action/svg/production/ic_settings_input_antenna_24px.svg - icons/action/svg/production/ic_settings_input_component_24px.svg - icons/action/svg/production/ic_settings_input_composite_24px.svg - icons/action/svg/production/ic_settings_input_hdmi_24px.svg - icons/action/svg/production/ic_settings_input_svideo_24px.svg - icons/action/svg/production/ic_settings_overscan_24px.svg - icons/action/svg/production/ic_settings_phone_24px.svg - icons/action/svg/production/ic_settings_power_24px.svg - icons/action/svg/production/ic_settings_remote_24px.svg - icons/action/svg/production/ic_settings_voice_24px.svg - icons/action/svg/production/ic_shop_24px.svg - icons/action/svg/production/ic_shop_two_24px.svg - icons/action/svg/production/ic_shopping_basket_24px.svg - icons/action/svg/production/ic_shopping_cart_24px.svg - icons/action/svg/production/ic_speaker_notes_24px.svg - icons/action/svg/production/ic_speaker_notes_off_24px.svg - icons/action/svg/production/ic_spellcheck_24px.svg - icons/action/svg/production/ic_stars_24px.svg - icons/action/svg/production/ic_store_24px.svg - icons/action/svg/production/ic_subject_24px.svg - icons/action/svg/production/ic_supervisor_account_24px.svg - icons/action/svg/production/ic_swap_horiz_24px.svg - icons/action/svg/production/ic_swap_vert_24px.svg - icons/action/svg/production/ic_swap_vertical_circle_24px.svg - icons/action/svg/production/ic_system_update_alt_24px.svg - icons/action/svg/production/ic_tab_24px.svg - icons/action/svg/production/ic_tab_unselected_24px.svg - icons/action/svg/production/ic_theaters_24px.svg - icons/action/svg/production/ic_thumb_down_24px.svg - icons/action/svg/production/ic_thumb_up_24px.svg - icons/action/svg/production/ic_thumbs_up_down_24px.svg - icons/action/svg/production/ic_timeline_24px.svg - icons/action/svg/production/ic_toc_24px.svg - icons/action/svg/production/ic_today_24px.svg - icons/action/svg/production/ic_toll_24px.svg - icons/action/svg/production/ic_touch_app_24px.svg - icons/action/svg/production/ic_track_changes_24px.svg - icons/action/svg/production/ic_translate_24px.svg - icons/action/svg/production/ic_trending_down_24px.svg - icons/action/svg/production/ic_trending_flat_24px.svg - icons/action/svg/production/ic_trending_up_24px.svg - icons/action/svg/production/ic_turned_in_24px.svg - icons/action/svg/production/ic_turned_in_not_24px.svg - icons/action/svg/production/ic_update_24px.svg - icons/action/svg/production/ic_verified_user_24px.svg - icons/action/svg/production/ic_view_agenda_24px.svg - icons/action/svg/production/ic_view_array_24px.svg - icons/action/svg/production/ic_view_carousel_24px.svg - icons/action/svg/production/ic_view_column_24px.svg - icons/action/svg/production/ic_view_day_24px.svg - icons/action/svg/production/ic_view_headline_24px.svg - icons/action/svg/production/ic_view_list_24px.svg - icons/action/svg/production/ic_view_module_24px.svg - icons/action/svg/production/ic_view_quilt_24px.svg - icons/action/svg/production/ic_view_stream_24px.svg - icons/action/svg/production/ic_view_week_24px.svg - icons/action/svg/production/ic_visibility_24px.svg - icons/action/svg/production/ic_visibility_off_24px.svg - icons/action/svg/production/ic_watch_later_24px.svg - icons/action/svg/production/ic_work_24px.svg - icons/action/svg/production/ic_youtube_searched_for_24px.svg - icons/action/svg/production/ic_zoom_in_24px.svg - icons/action/svg/production/ic_zoom_out_24px.svg - icons/alert/svg/production/ic_add_alert_24px.svg - icons/alert/svg/production/ic_error_24px.svg - icons/alert/svg/production/ic_error_outline_24px.svg - icons/alert/svg/production/ic_warning_24px.svg - icons/av/svg/production/ic_add_to_queue_24px.svg - icons/av/svg/production/ic_airplay_24px.svg - icons/av/svg/production/ic_album_24px.svg - icons/av/svg/production/ic_art_track_24px.svg - icons/av/svg/production/ic_av_timer_24px.svg - icons/av/svg/production/ic_branding_watermark_24px.svg - icons/av/svg/production/ic_call_to_action_24px.svg - icons/av/svg/production/ic_closed_caption_24px.svg - icons/av/svg/production/ic_equalizer_24px.svg - icons/av/svg/production/ic_explicit_24px.svg - icons/av/svg/production/ic_fast_forward_24px.svg - icons/av/svg/production/ic_fast_rewind_24px.svg - icons/av/svg/production/ic_featured_play_list_24px.svg - icons/av/svg/production/ic_featured_video_24px.svg - icons/av/svg/production/ic_fiber_dvr_24px.svg - icons/av/svg/production/ic_fiber_manual_record_24px.svg - icons/av/svg/production/ic_fiber_new_24px.svg - icons/av/svg/production/ic_fiber_pin_24px.svg - icons/av/svg/production/ic_fiber_smart_record_24px.svg - icons/av/svg/production/ic_forward_5_24px.svg - icons/av/svg/production/ic_forward_10_24px.svg - icons/av/svg/production/ic_forward_30_24px.svg - icons/av/svg/production/ic_games_24px.svg - icons/av/svg/production/ic_hd_24px.svg - icons/av/svg/production/ic_hearing_24px.svg - icons/av/svg/production/ic_high_quality_24px.svg - icons/av/svg/production/ic_library_add_24px.svg - icons/av/svg/production/ic_library_books_24px.svg - icons/av/svg/production/ic_library_music_24px.svg - icons/av/svg/production/ic_loop_24px.svg - icons/av/svg/production/ic_mic_24px.svg - icons/av/svg/production/ic_mic_none_24px.svg - icons/av/svg/production/ic_mic_off_24px.svg - icons/av/svg/production/ic_movie_24px.svg - icons/av/svg/production/ic_music_video_24px.svg - icons/av/svg/production/ic_new_releases_24px.svg - icons/av/svg/production/ic_not_interested_24px.svg - icons/av/svg/production/ic_note_24px.svg - icons/av/svg/production/ic_pause_24px.svg - icons/av/svg/production/ic_pause_circle_filled_24px.svg - icons/av/svg/production/ic_pause_circle_outline_24px.svg - icons/av/svg/production/ic_play_arrow_24px.svg - icons/av/svg/production/ic_play_circle_filled_24px.svg - icons/av/svg/production/ic_play_circle_outline_24px.svg - icons/av/svg/production/ic_playlist_add_24px.svg - icons/av/svg/production/ic_playlist_add_check_24px.svg - icons/av/svg/production/ic_playlist_play_24px.svg - icons/av/svg/production/ic_queue_24px.svg - icons/av/svg/production/ic_queue_music_24px.svg - icons/av/svg/production/ic_queue_play_next_24px.svg - icons/av/svg/production/ic_radio_24px.svg - icons/av/svg/production/ic_recent_actors_24px.svg - icons/av/svg/production/ic_remove_from_queue_24px.svg - icons/av/svg/production/ic_repeat_24px.svg - icons/av/svg/production/ic_repeat_one_24px.svg - icons/av/svg/production/ic_replay_5_24px.svg - icons/av/svg/production/ic_replay_10_24px.svg - icons/av/svg/production/ic_replay_24px.svg - icons/av/svg/production/ic_replay_30_24px.svg - icons/av/svg/production/ic_shuffle_24px.svg - icons/av/svg/production/ic_skip_next_24px.svg - icons/av/svg/production/ic_skip_previous_24px.svg - icons/av/svg/production/ic_slow_motion_video_24px.svg - icons/av/svg/production/ic_snooze_24px.svg - icons/av/svg/production/ic_sort_by_alpha_24px.svg - icons/av/svg/production/ic_stop_24px.svg - icons/av/svg/production/ic_subscriptions_24px.svg - icons/av/svg/production/ic_subtitles_24px.svg - icons/av/svg/production/ic_surround_sound_24px.svg - icons/av/svg/production/ic_video_call_24px.svg - icons/av/svg/production/ic_video_label_24px.svg - icons/av/svg/production/ic_video_library_24px.svg - icons/av/svg/production/ic_videocam_24px.svg - icons/av/svg/production/ic_videocam_off_24px.svg - icons/av/svg/production/ic_volume_down_24px.svg - icons/av/svg/production/ic_volume_mute_24px.svg - icons/av/svg/production/ic_volume_off_24px.svg - icons/av/svg/production/ic_volume_up_24px.svg - icons/av/svg/production/ic_web_24px.svg - icons/av/svg/production/ic_web_asset_24px.svg - icons/content/svg/production/ic_add_24px.svg - icons/content/svg/production/ic_add_box_24px.svg - icons/content/svg/production/ic_add_circle_24px.svg - icons/content/svg/production/ic_add_circle_outline_24px.svg - icons/content/svg/production/ic_archive_24px.svg - icons/content/svg/production/ic_backspace_24px.svg - icons/content/svg/production/ic_block_24px.svg - icons/content/svg/production/ic_clear_24px.svg - icons/content/svg/production/ic_content_copy_24px.svg - icons/content/svg/production/ic_content_cut_24px.svg - icons/content/svg/production/ic_content_paste_24px.svg - icons/content/svg/production/ic_create_24px.svg - icons/content/svg/production/ic_delete_sweep_24px.svg - icons/content/svg/production/ic_drafts_24px.svg - icons/content/svg/production/ic_filter_list_24px.svg - icons/content/svg/production/ic_flag_24px.svg - icons/content/svg/production/ic_font_download_24px.svg - icons/content/svg/production/ic_forward_24px.svg - icons/content/svg/production/ic_gesture_24px.svg - icons/content/svg/production/ic_inbox_24px.svg - icons/content/svg/production/ic_link_24px.svg - icons/content/svg/production/ic_low_priority_24px.svg - icons/content/svg/production/ic_mail_24px.svg - icons/content/svg/production/ic_markunread_24px.svg - icons/content/svg/production/ic_move_to_inbox_24px.svg - icons/content/svg/production/ic_next_week_24px.svg - icons/content/svg/production/ic_redo_24px.svg - icons/content/svg/production/ic_remove_24px.svg - icons/content/svg/production/ic_remove_circle_24px.svg - icons/content/svg/production/ic_remove_circle_outline_24px.svg - icons/content/svg/production/ic_reply_24px.svg - icons/content/svg/production/ic_reply_all_24px.svg - icons/content/svg/production/ic_report_24px.svg - icons/content/svg/production/ic_save_24px.svg - icons/content/svg/production/ic_select_all_24px.svg - icons/content/svg/production/ic_send_24px.svg - icons/content/svg/production/ic_sort_24px.svg - icons/content/svg/production/ic_text_format_24px.svg - icons/content/svg/production/ic_unarchive_24px.svg - icons/content/svg/production/ic_undo_24px.svg - icons/content/svg/production/ic_weekend_24px.svg - icons/device/svg/production/ic_access_alarm_24px.svg - icons/device/svg/production/ic_access_alarms_24px.svg - icons/device/svg/production/ic_access_time_24px.svg - icons/device/svg/production/ic_add_alarm_24px.svg - icons/device/svg/production/ic_airplanemode_active_24px.svg - icons/device/svg/production/ic_airplanemode_inactive_24px.svg - icons/device/svg/production/ic_battery_20_24px.svg - icons/device/svg/production/ic_battery_30_24px.svg - icons/device/svg/production/ic_battery_50_24px.svg - icons/device/svg/production/ic_battery_60_24px.svg - icons/device/svg/production/ic_battery_80_24px.svg - icons/device/svg/production/ic_battery_90_24px.svg - icons/device/svg/production/ic_battery_alert_24px.svg - icons/device/svg/production/ic_battery_charging_20_24px.svg - icons/device/svg/production/ic_battery_charging_30_24px.svg - icons/device/svg/production/ic_battery_charging_50_24px.svg - icons/device/svg/production/ic_battery_charging_60_24px.svg - icons/device/svg/production/ic_battery_charging_80_24px.svg - icons/device/svg/production/ic_battery_charging_90_24px.svg - icons/device/svg/production/ic_battery_charging_full_24px.svg - icons/device/svg/production/ic_battery_full_24px.svg - icons/device/svg/production/ic_battery_std_24px.svg - icons/device/svg/production/ic_battery_unknown_24px.svg - icons/device/svg/production/ic_bluetooth_24px.svg - icons/device/svg/production/ic_bluetooth_connected_24px.svg - icons/device/svg/production/ic_bluetooth_disabled_24px.svg - icons/device/svg/production/ic_bluetooth_searching_24px.svg - icons/device/svg/production/ic_brightness_auto_24px.svg - icons/device/svg/production/ic_brightness_high_24px.svg - icons/device/svg/production/ic_brightness_low_24px.svg - icons/device/svg/production/ic_brightness_medium_24px.svg - icons/device/svg/production/ic_data_usage_24px.svg - icons/device/svg/production/ic_developer_mode_24px.svg - icons/device/svg/production/ic_devices_24px.svg - icons/device/svg/production/ic_dvr_24px.svg - icons/device/svg/production/ic_gps_fixed_24px.svg - icons/device/svg/production/ic_gps_not_fixed_24px.svg - icons/device/svg/production/ic_gps_off_24px.svg - icons/device/svg/production/ic_graphic_eq_24px.svg - icons/device/svg/production/ic_location_disabled_24px.svg - icons/device/svg/production/ic_location_searching_24px.svg - icons/device/svg/production/ic_network_cell_24px.svg - icons/device/svg/production/ic_network_wifi_24px.svg - icons/device/svg/production/ic_nfc_24px.svg - icons/device/svg/production/ic_screen_lock_landscape_24px.svg - icons/device/svg/production/ic_screen_lock_portrait_24px.svg - icons/device/svg/production/ic_screen_lock_rotation_24px.svg - icons/device/svg/production/ic_screen_rotation_24px.svg - icons/device/svg/production/ic_sd_storage_24px.svg - icons/device/svg/production/ic_settings_system_daydream_24px.svg - icons/device/svg/production/ic_signal_cellular_0_bar_24px.svg - icons/device/svg/production/ic_signal_cellular_1_bar_24px.svg - icons/device/svg/production/ic_signal_cellular_2_bar_24px.svg - icons/device/svg/production/ic_signal_cellular_3_bar_24px.svg - icons/device/svg/production/ic_signal_cellular_4_bar_24px.svg - icons/device/svg/production/ic_signal_cellular_connected_no_internet_0_bar_24px.svg - icons/device/svg/production/ic_signal_cellular_connected_no_internet_1_bar_24px.svg - icons/device/svg/production/ic_signal_cellular_connected_no_internet_2_bar_24px.svg - icons/device/svg/production/ic_signal_cellular_connected_no_internet_3_bar_24px.svg - icons/device/svg/production/ic_signal_cellular_connected_no_internet_4_bar_24px.svg - icons/device/svg/production/ic_signal_cellular_no_sim_24px.svg - icons/device/svg/production/ic_signal_cellular_null_24px.svg - icons/device/svg/production/ic_signal_cellular_off_24px.svg - icons/device/svg/production/ic_signal_wifi_0_bar_24px.svg - icons/device/svg/production/ic_signal_wifi_1_bar_24px.svg - icons/device/svg/production/ic_signal_wifi_1_bar_lock_24px.svg - icons/device/svg/production/ic_signal_wifi_2_bar_24px.svg - icons/device/svg/production/ic_signal_wifi_2_bar_lock_24px.svg - icons/device/svg/production/ic_signal_wifi_3_bar_24px.svg - icons/device/svg/production/ic_signal_wifi_3_bar_lock_24px.svg - icons/device/svg/production/ic_signal_wifi_4_bar_24px.svg - icons/device/svg/production/ic_signal_wifi_4_bar_lock_24px.svg - icons/device/svg/production/ic_signal_wifi_off_24px.svg - icons/device/svg/production/ic_storage_24px.svg - icons/device/svg/production/ic_usb_24px.svg - icons/device/svg/production/ic_wallpaper_24px.svg - icons/device/svg/production/ic_widgets_24px.svg - icons/device/svg/production/ic_wifi_lock_24px.svg - icons/device/svg/production/ic_wifi_tethering_24px.svg - icons/editor/svg/production/ic_attach_file_24px.svg - icons/editor/svg/production/ic_attach_money_24px.svg - icons/editor/svg/production/ic_border_all_24px.svg - icons/editor/svg/production/ic_border_bottom_24px.svg - icons/editor/svg/production/ic_border_clear_24px.svg - icons/editor/svg/production/ic_border_color_24px.svg - icons/editor/svg/production/ic_border_horizontal_24px.svg - icons/editor/svg/production/ic_border_inner_24px.svg - icons/editor/svg/production/ic_border_left_24px.svg - icons/editor/svg/production/ic_border_outer_24px.svg - icons/editor/svg/production/ic_border_right_24px.svg - icons/editor/svg/production/ic_border_style_24px.svg - icons/editor/svg/production/ic_border_top_24px.svg - icons/editor/svg/production/ic_border_vertical_24px.svg - icons/editor/svg/production/ic_bubble_chart_24px.svg - icons/editor/svg/production/ic_drag_handle_24px.svg - icons/editor/svg/production/ic_format_align_center_24px.svg - icons/editor/svg/production/ic_format_align_justify_24px.svg - icons/editor/svg/production/ic_format_align_left_24px.svg - icons/editor/svg/production/ic_format_align_right_24px.svg - icons/editor/svg/production/ic_format_bold_24px.svg - icons/editor/svg/production/ic_format_clear_24px.svg - icons/editor/svg/production/ic_format_color_fill_24px.svg - icons/editor/svg/production/ic_format_color_reset_24px.svg - icons/editor/svg/production/ic_format_color_text_24px.svg - icons/editor/svg/production/ic_format_indent_decrease_24px.svg - icons/editor/svg/production/ic_format_indent_increase_24px.svg - icons/editor/svg/production/ic_format_italic_24px.svg - icons/editor/svg/production/ic_format_line_spacing_24px.svg - icons/editor/svg/production/ic_format_list_bulleted_24px.svg - icons/editor/svg/production/ic_format_list_numbered_24px.svg - icons/editor/svg/production/ic_format_paint_24px.svg - icons/editor/svg/production/ic_format_quote_24px.svg - icons/editor/svg/production/ic_format_shapes_24px.svg - icons/editor/svg/production/ic_format_size_24px.svg - icons/editor/svg/production/ic_format_strikethrough_24px.svg - icons/editor/svg/production/ic_format_textdirection_l_to_r_24px.svg - icons/editor/svg/production/ic_format_textdirection_r_to_l_24px.svg - icons/editor/svg/production/ic_format_underlined_24px.svg - icons/editor/svg/production/ic_functions_24px.svg - icons/editor/svg/production/ic_highlight_24px.svg - icons/editor/svg/production/ic_insert_chart_24px.svg - icons/editor/svg/production/ic_insert_comment_24px.svg - icons/editor/svg/production/ic_insert_drive_file_24px.svg - icons/editor/svg/production/ic_insert_emoticon_24px.svg - icons/editor/svg/production/ic_insert_invitation_24px.svg - icons/editor/svg/production/ic_insert_link_24px.svg - icons/editor/svg/production/ic_insert_photo_24px.svg - icons/editor/svg/production/ic_linear_scale_24px.svg - icons/editor/svg/production/ic_merge_type_24px.svg - icons/editor/svg/production/ic_mode_comment_24px.svg - icons/editor/svg/production/ic_mode_edit_24px.svg - icons/editor/svg/production/ic_monetization_on_24px.svg - icons/editor/svg/production/ic_money_off_24px.svg - icons/editor/svg/production/ic_multiline_chart_24px.svg - icons/editor/svg/production/ic_pie_chart_24px.svg - icons/editor/svg/production/ic_pie_chart_outlined_24px.svg - icons/editor/svg/production/ic_publish_24px.svg - icons/editor/svg/production/ic_short_text_24px.svg - icons/editor/svg/production/ic_show_chart_24px.svg - icons/editor/svg/production/ic_space_bar_24px.svg - icons/editor/svg/production/ic_strikethrough_s_24px.svg - icons/editor/svg/production/ic_text_fields_24px.svg - icons/editor/svg/production/ic_title_24px.svg - icons/editor/svg/production/ic_vertical_align_bottom_24px.svg - icons/editor/svg/production/ic_vertical_align_center_24px.svg - icons/editor/svg/production/ic_vertical_align_top_24px.svg - icons/editor/svg/production/ic_wrap_text_24px.svg - icons/file/svg/production/ic_attachment_24px.svg - icons/file/svg/production/ic_cloud_24px.svg - icons/file/svg/production/ic_cloud_circle_24px.svg - icons/file/svg/production/ic_cloud_done_24px.svg - icons/file/svg/production/ic_cloud_download_24px.svg - icons/file/svg/production/ic_cloud_off_24px.svg - icons/file/svg/production/ic_cloud_queue_24px.svg - icons/file/svg/production/ic_cloud_upload_24px.svg - icons/file/svg/production/ic_create_new_folder_24px.svg - icons/file/svg/production/ic_file_download_24px.svg - icons/file/svg/production/ic_file_upload_24px.svg - icons/file/svg/production/ic_folder_24px.svg - icons/file/svg/production/ic_folder_open_24px.svg - icons/file/svg/production/ic_folder_shared_24px.svg - icons/hardware/svg/production/ic_cast_24px.svg - icons/hardware/svg/production/ic_cast_connected_24px.svg - icons/hardware/svg/production/ic_computer_24px.svg - icons/hardware/svg/production/ic_desktop_mac_24px.svg - icons/hardware/svg/production/ic_desktop_windows_24px.svg - icons/hardware/svg/production/ic_developer_board_24px.svg - icons/hardware/svg/production/ic_device_hub_24px.svg - icons/hardware/svg/production/ic_devices_other_24px.svg - icons/hardware/svg/production/ic_dock_24px.svg - icons/hardware/svg/production/ic_gamepad_24px.svg - icons/hardware/svg/production/ic_headset_24px.svg - icons/hardware/svg/production/ic_headset_mic_24px.svg - icons/hardware/svg/production/ic_keyboard_24px.svg - icons/hardware/svg/production/ic_keyboard_arrow_down_24px.svg - icons/hardware/svg/production/ic_keyboard_arrow_left_24px.svg - icons/hardware/svg/production/ic_keyboard_arrow_right_24px.svg - icons/hardware/svg/production/ic_keyboard_arrow_up_24px.svg - icons/hardware/svg/production/ic_keyboard_backspace_24px.svg - icons/hardware/svg/production/ic_keyboard_capslock_24px.svg - icons/hardware/svg/production/ic_keyboard_hide_24px.svg - icons/hardware/svg/production/ic_keyboard_return_24px.svg - icons/hardware/svg/production/ic_keyboard_tab_24px.svg - icons/hardware/svg/production/ic_keyboard_voice_24px.svg - icons/hardware/svg/production/ic_laptop_24px.svg - icons/hardware/svg/production/ic_laptop_chromebook_24px.svg - icons/hardware/svg/production/ic_laptop_mac_24px.svg - icons/hardware/svg/production/ic_laptop_windows_24px.svg - icons/hardware/svg/production/ic_memory_24px.svg - icons/hardware/svg/production/ic_mouse_24px.svg - icons/hardware/svg/production/ic_phone_android_24px.svg - icons/hardware/svg/production/ic_phone_iphone_24px.svg - icons/hardware/svg/production/ic_phonelink_24px.svg - icons/hardware/svg/production/ic_phonelink_off_24px.svg - icons/hardware/svg/production/ic_power_input_24px.svg - icons/hardware/svg/production/ic_router_24px.svg - icons/hardware/svg/production/ic_scanner_24px.svg - icons/hardware/svg/production/ic_security_24px.svg - icons/hardware/svg/production/ic_sim_card_24px.svg - icons/hardware/svg/production/ic_smartphone_24px.svg - icons/hardware/svg/production/ic_speaker_24px.svg - icons/hardware/svg/production/ic_speaker_group_24px.svg - icons/hardware/svg/production/ic_tablet_24px.svg - icons/hardware/svg/production/ic_tablet_android_24px.svg - icons/hardware/svg/production/ic_tablet_mac_24px.svg - icons/hardware/svg/production/ic_toys_24px.svg - icons/hardware/svg/production/ic_tv_24px.svg - icons/hardware/svg/production/ic_videogame_asset_24px.svg - icons/hardware/svg/production/ic_watch_24px.svg - icons/image/svg/production/ic_add_a_photo_24px.svg - icons/image/svg/production/ic_add_to_photos_24px.svg - icons/image/svg/production/ic_adjust_24px.svg - icons/image/svg/production/ic_assistant_24px.svg - icons/image/svg/production/ic_assistant_photo_24px.svg - icons/image/svg/production/ic_audiotrack_24px.svg - icons/image/svg/production/ic_blur_circular_24px.svg - icons/image/svg/production/ic_blur_linear_24px.svg - icons/image/svg/production/ic_blur_off_24px.svg - icons/image/svg/production/ic_blur_on_24px.svg - icons/image/svg/production/ic_brightness_1_24px.svg - icons/image/svg/production/ic_brightness_2_24px.svg - icons/image/svg/production/ic_brightness_3_24px.svg - icons/image/svg/production/ic_brightness_4_24px.svg - icons/image/svg/production/ic_brightness_5_24px.svg - icons/image/svg/production/ic_brightness_6_24px.svg - icons/image/svg/production/ic_brightness_7_24px.svg - icons/image/svg/production/ic_broken_image_24px.svg - icons/image/svg/production/ic_brush_24px.svg - icons/image/svg/production/ic_burst_mode_24px.svg - icons/image/svg/production/ic_camera_24px.svg - icons/image/svg/production/ic_camera_alt_24px.svg - icons/image/svg/production/ic_camera_front_24px.svg - icons/image/svg/production/ic_camera_rear_24px.svg - icons/image/svg/production/ic_camera_roll_24px.svg - icons/image/svg/production/ic_center_focus_strong_24px.svg - icons/image/svg/production/ic_center_focus_weak_24px.svg - icons/image/svg/production/ic_collections_24px.svg - icons/image/svg/production/ic_collections_bookmark_24px.svg - icons/image/svg/production/ic_color_lens_24px.svg - icons/image/svg/production/ic_colorize_24px.svg - icons/image/svg/production/ic_compare_24px.svg - icons/image/svg/production/ic_control_point_24px.svg - icons/image/svg/production/ic_control_point_duplicate_24px.svg - icons/image/svg/production/ic_crop_3_2_24px.svg - icons/image/svg/production/ic_crop_5_4_24px.svg - icons/image/svg/production/ic_crop_7_5_24px.svg - icons/image/svg/production/ic_crop_16_9_24px.svg - icons/image/svg/production/ic_crop_24px.svg - icons/image/svg/production/ic_crop_din_24px.svg - icons/image/svg/production/ic_crop_free_24px.svg - icons/image/svg/production/ic_crop_landscape_24px.svg - icons/image/svg/production/ic_crop_original_24px.svg - icons/image/svg/production/ic_crop_portrait_24px.svg - icons/image/svg/production/ic_crop_rotate_24px.svg - icons/image/svg/production/ic_crop_square_24px.svg - icons/image/svg/production/ic_dehaze_24px.svg - icons/image/svg/production/ic_details_24px.svg - icons/image/svg/production/ic_edit_24px.svg - icons/image/svg/production/ic_exposure_24px.svg - icons/image/svg/production/ic_exposure_neg_1_24px.svg - icons/image/svg/production/ic_exposure_neg_2_24px.svg - icons/image/svg/production/ic_exposure_plus_1_24px.svg - icons/image/svg/production/ic_exposure_plus_2_24px.svg - icons/image/svg/production/ic_exposure_zero_24px.svg - icons/image/svg/production/ic_filter_1_24px.svg - icons/image/svg/production/ic_filter_2_24px.svg - icons/image/svg/production/ic_filter_3_24px.svg - icons/image/svg/production/ic_filter_4_24px.svg - icons/image/svg/production/ic_filter_5_24px.svg - icons/image/svg/production/ic_filter_6_24px.svg - icons/image/svg/production/ic_filter_7_24px.svg - icons/image/svg/production/ic_filter_8_24px.svg - icons/image/svg/production/ic_filter_9_24px.svg - icons/image/svg/production/ic_filter_9_plus_24px.svg - icons/image/svg/production/ic_filter_24px.svg - icons/image/svg/production/ic_filter_b_and_w_24px.svg - icons/image/svg/production/ic_filter_center_focus_24px.svg - icons/image/svg/production/ic_filter_drama_24px.svg - icons/image/svg/production/ic_filter_frames_24px.svg - icons/image/svg/production/ic_filter_hdr_24px.svg - icons/image/svg/production/ic_filter_none_24px.svg - icons/image/svg/production/ic_filter_tilt_shift_24px.svg - icons/image/svg/production/ic_filter_vintage_24px.svg - icons/image/svg/production/ic_flare_24px.svg - icons/image/svg/production/ic_flash_auto_24px.svg - icons/image/svg/production/ic_flash_off_24px.svg - icons/image/svg/production/ic_flash_on_24px.svg - icons/image/svg/production/ic_flip_24px.svg - icons/image/svg/production/ic_gradient_24px.svg - icons/image/svg/production/ic_grain_24px.svg - icons/image/svg/production/ic_grid_off_24px.svg - icons/image/svg/production/ic_grid_on_24px.svg - icons/image/svg/production/ic_hdr_off_24px.svg - icons/image/svg/production/ic_hdr_on_24px.svg - icons/image/svg/production/ic_hdr_strong_24px.svg - icons/image/svg/production/ic_hdr_weak_24px.svg - icons/image/svg/production/ic_healing_24px.svg - icons/image/svg/production/ic_image_24px.svg - icons/image/svg/production/ic_image_aspect_ratio_24px.svg - icons/image/svg/production/ic_iso_24px.svg - icons/image/svg/production/ic_landscape_24px.svg - icons/image/svg/production/ic_leak_add_24px.svg - icons/image/svg/production/ic_leak_remove_24px.svg - icons/image/svg/production/ic_lens_24px.svg - icons/image/svg/production/ic_linked_camera_24px.svg - icons/image/svg/production/ic_looks_3_24px.svg - icons/image/svg/production/ic_looks_4_24px.svg - icons/image/svg/production/ic_looks_5_24px.svg - icons/image/svg/production/ic_looks_6_24px.svg - icons/image/svg/production/ic_looks_24px.svg - icons/image/svg/production/ic_looks_one_24px.svg - icons/image/svg/production/ic_looks_two_24px.svg - icons/image/svg/production/ic_loupe_24px.svg - icons/image/svg/production/ic_monochrome_photos_24px.svg - icons/image/svg/production/ic_movie_creation_24px.svg - icons/image/svg/production/ic_movie_filter_24px.svg - icons/image/svg/production/ic_music_note_24px.svg - icons/image/svg/production/ic_nature_24px.svg - icons/image/svg/production/ic_nature_people_24px.svg - icons/image/svg/production/ic_navigate_before_24px.svg - icons/image/svg/production/ic_navigate_next_24px.svg - icons/image/svg/production/ic_palette_24px.svg - icons/image/svg/production/ic_panorama_24px.svg - icons/image/svg/production/ic_panorama_fish_eye_24px.svg - icons/image/svg/production/ic_panorama_horizontal_24px.svg - icons/image/svg/production/ic_panorama_vertical_24px.svg - icons/image/svg/production/ic_panorama_wide_angle_24px.svg - icons/image/svg/production/ic_photo_24px.svg - icons/image/svg/production/ic_photo_album_24px.svg - icons/image/svg/production/ic_photo_camera_24px.svg - icons/image/svg/production/ic_photo_filter_24px.svg - icons/image/svg/production/ic_photo_library_24px.svg - icons/image/svg/production/ic_photo_size_select_actual_24px.svg - icons/image/svg/production/ic_photo_size_select_large_24px.svg - icons/image/svg/production/ic_photo_size_select_small_24px.svg - icons/image/svg/production/ic_picture_as_pdf_24px.svg - icons/image/svg/production/ic_portrait_24px.svg - icons/image/svg/production/ic_remove_red_eye_24px.svg - icons/image/svg/production/ic_rotate_90_degrees_ccw_24px.svg - icons/image/svg/production/ic_rotate_left_24px.svg - icons/image/svg/production/ic_rotate_right_24px.svg - icons/image/svg/production/ic_slideshow_24px.svg - icons/image/svg/production/ic_straighten_24px.svg - icons/image/svg/production/ic_style_24px.svg - icons/image/svg/production/ic_switch_camera_24px.svg - icons/image/svg/production/ic_switch_video_24px.svg - icons/image/svg/production/ic_tag_faces_24px.svg - icons/image/svg/production/ic_texture_24px.svg - icons/image/svg/production/ic_timelapse_24px.svg - icons/image/svg/production/ic_timer_3_24px.svg - icons/image/svg/production/ic_timer_10_24px.svg - icons/image/svg/production/ic_timer_24px.svg - icons/image/svg/production/ic_timer_off_24px.svg - icons/image/svg/production/ic_tonality_24px.svg - icons/image/svg/production/ic_transform_24px.svg - icons/image/svg/production/ic_tune_24px.svg - icons/image/svg/production/ic_view_comfy_24px.svg - icons/image/svg/production/ic_view_compact_24px.svg - icons/image/svg/production/ic_vignette_24px.svg - icons/image/svg/production/ic_wb_auto_24px.svg - icons/image/svg/production/ic_wb_cloudy_24px.svg - icons/image/svg/production/ic_wb_incandescent_24px.svg - icons/image/svg/production/ic_wb_iridescent_24px.svg - icons/image/svg/production/ic_wb_sunny_24px.svg - icons/maps/svg/production/ic_add_location_24px.svg - icons/maps/svg/production/ic_beenhere_24px.svg - icons/maps/svg/production/ic_directions_24px.svg - icons/maps/svg/production/ic_directions_bike_24px.svg - icons/maps/svg/production/ic_directions_boat_24px.svg - icons/maps/svg/production/ic_directions_bus_24px.svg - icons/maps/svg/production/ic_directions_car_24px.svg - icons/maps/svg/production/ic_directions_railway_24px.svg - icons/maps/svg/production/ic_directions_run_24px.svg - icons/maps/svg/production/ic_directions_subway_24px.svg - icons/maps/svg/production/ic_directions_transit_24px.svg - icons/maps/svg/production/ic_directions_walk_24px.svg - icons/maps/svg/production/ic_edit_location_24px.svg - icons/maps/svg/production/ic_ev_station_24px.svg - icons/maps/svg/production/ic_flight_24px.svg - icons/maps/svg/production/ic_hotel_24px.svg - icons/maps/svg/production/ic_layers_24px.svg - icons/maps/svg/production/ic_layers_clear_24px.svg - icons/maps/svg/production/ic_local_activity_24px.svg - icons/maps/svg/production/ic_local_airport_24px.svg - icons/maps/svg/production/ic_local_atm_24px.svg - icons/maps/svg/production/ic_local_bar_24px.svg - icons/maps/svg/production/ic_local_cafe_24px.svg - icons/maps/svg/production/ic_local_car_wash_24px.svg - icons/maps/svg/production/ic_local_convenience_store_24px.svg - icons/maps/svg/production/ic_local_dining_24px.svg - icons/maps/svg/production/ic_local_drink_24px.svg - icons/maps/svg/production/ic_local_florist_24px.svg - icons/maps/svg/production/ic_local_gas_station_24px.svg - icons/maps/svg/production/ic_local_grocery_store_24px.svg - icons/maps/svg/production/ic_local_hospital_24px.svg - icons/maps/svg/production/ic_local_hotel_24px.svg - icons/maps/svg/production/ic_local_laundry_service_24px.svg - icons/maps/svg/production/ic_local_library_24px.svg - icons/maps/svg/production/ic_local_mall_24px.svg - icons/maps/svg/production/ic_local_movies_24px.svg - icons/maps/svg/production/ic_local_offer_24px.svg - icons/maps/svg/production/ic_local_parking_24px.svg - icons/maps/svg/production/ic_local_pharmacy_24px.svg - icons/maps/svg/production/ic_local_phone_24px.svg - icons/maps/svg/production/ic_local_pizza_24px.svg - icons/maps/svg/production/ic_local_play_24px.svg - icons/maps/svg/production/ic_local_post_office_24px.svg - icons/maps/svg/production/ic_local_printshop_24px.svg - icons/maps/svg/production/ic_local_see_24px.svg - icons/maps/svg/production/ic_local_shipping_24px.svg - icons/maps/svg/production/ic_local_taxi_24px.svg - icons/maps/svg/production/ic_map_24px.svg - icons/maps/svg/production/ic_my_location_24px.svg - icons/maps/svg/production/ic_navigation_24px.svg - icons/maps/svg/production/ic_near_me_24px.svg - icons/maps/svg/production/ic_person_pin_24px.svg - icons/maps/svg/production/ic_person_pin_circle_24px.svg - icons/maps/svg/production/ic_pin_drop_24px.svg - icons/maps/svg/production/ic_place_24px.svg - icons/maps/svg/production/ic_rate_review_24px.svg - icons/maps/svg/production/ic_restaurant_24px.svg - icons/maps/svg/production/ic_restaurant_menu_24px.svg - icons/maps/svg/production/ic_satellite_24px.svg - icons/maps/svg/production/ic_store_mall_directory_24px.svg - icons/maps/svg/production/ic_streetview_24px.svg - icons/maps/svg/production/ic_subway_24px.svg - icons/maps/svg/production/ic_terrain_24px.svg - icons/maps/svg/production/ic_traffic_24px.svg - icons/maps/svg/production/ic_train_24px.svg - icons/maps/svg/production/ic_tram_24px.svg - icons/maps/svg/production/ic_transfer_within_a_station_24px.svg - icons/maps/svg/production/ic_zoom_out_map_24px.svg - icons/navigation/svg/production/ic_apps_24px.svg - icons/navigation/svg/production/ic_arrow_back_24px.svg - icons/navigation/svg/production/ic_arrow_downward_24px.svg - icons/navigation/svg/production/ic_arrow_drop_down_24px.svg - icons/navigation/svg/production/ic_arrow_drop_down_circle_24px.svg - icons/navigation/svg/production/ic_arrow_drop_up_24px.svg - icons/navigation/svg/production/ic_arrow_forward_24px.svg - icons/navigation/svg/production/ic_arrow_upward_24px.svg - icons/navigation/svg/production/ic_cancel_24px.svg - icons/navigation/svg/production/ic_check_24px.svg - icons/navigation/svg/production/ic_chevron_left_24px.svg - icons/navigation/svg/production/ic_chevron_right_24px.svg - icons/navigation/svg/production/ic_close_24px.svg - icons/navigation/svg/production/ic_expand_less_24px.svg - icons/navigation/svg/production/ic_expand_more_24px.svg - icons/navigation/svg/production/ic_first_page_24px.svg - icons/navigation/svg/production/ic_fullscreen_24px.svg - icons/navigation/svg/production/ic_fullscreen_exit_24px.svg - icons/navigation/svg/production/ic_last_page_24px.svg - icons/navigation/svg/production/ic_menu_24px.svg - icons/navigation/svg/production/ic_more_horiz_24px.svg - icons/navigation/svg/production/ic_more_vert_24px.svg - icons/navigation/svg/production/ic_refresh_24px.svg - icons/navigation/svg/production/ic_subdirectory_arrow_left_24px.svg - icons/navigation/svg/production/ic_subdirectory_arrow_right_24px.svg - icons/navigation/svg/production/ic_unfold_less_24px.svg - icons/navigation/svg/production/ic_unfold_more_24px.svg - icons/notification/svg/production/ic_adb_24px.svg - icons/notification/svg/production/ic_airline_seat_flat_24px.svg - icons/notification/svg/production/ic_airline_seat_flat_angled_24px.svg - icons/notification/svg/production/ic_airline_seat_individual_suite_24px.svg - icons/notification/svg/production/ic_airline_seat_legroom_extra_24px.svg - icons/notification/svg/production/ic_airline_seat_legroom_normal_24px.svg - icons/notification/svg/production/ic_airline_seat_legroom_reduced_24px.svg - icons/notification/svg/production/ic_airline_seat_recline_extra_24px.svg - icons/notification/svg/production/ic_airline_seat_recline_normal_24px.svg - icons/notification/svg/production/ic_bluetooth_audio_24px.svg - icons/notification/svg/production/ic_confirmation_number_24px.svg - icons/notification/svg/production/ic_disc_full_24px.svg - icons/notification/svg/production/ic_do_not_disturb_24px.svg - icons/notification/svg/production/ic_do_not_disturb_alt_24px.svg - icons/notification/svg/production/ic_do_not_disturb_off_24px.svg - icons/notification/svg/production/ic_do_not_disturb_on_24px.svg - icons/notification/svg/production/ic_drive_eta_24px.svg - icons/notification/svg/production/ic_enhanced_encryption_24px.svg - icons/notification/svg/production/ic_event_available_24px.svg - icons/notification/svg/production/ic_event_busy_24px.svg - icons/notification/svg/production/ic_event_note_24px.svg - icons/notification/svg/production/ic_folder_special_24px.svg - icons/notification/svg/production/ic_live_tv_24px.svg - icons/notification/svg/production/ic_mms_24px.svg - icons/notification/svg/production/ic_more_24px.svg - icons/notification/svg/production/ic_network_check_24px.svg - icons/notification/svg/production/ic_network_locked_24px.svg - icons/notification/svg/production/ic_no_encryption_24px.svg - icons/notification/svg/production/ic_ondemand_video_24px.svg - icons/notification/svg/production/ic_personal_video_24px.svg - icons/notification/svg/production/ic_phone_bluetooth_speaker_24px.svg - icons/notification/svg/production/ic_phone_forwarded_24px.svg - icons/notification/svg/production/ic_phone_in_talk_24px.svg - icons/notification/svg/production/ic_phone_locked_24px.svg - icons/notification/svg/production/ic_phone_missed_24px.svg - icons/notification/svg/production/ic_phone_paused_24px.svg - icons/notification/svg/production/ic_power_24px.svg - icons/notification/svg/production/ic_priority_high_24px.svg - icons/notification/svg/production/ic_rv_hookup_24px.svg - icons/notification/svg/production/ic_sd_card_24px.svg - icons/notification/svg/production/ic_sim_card_alert_24px.svg - icons/notification/svg/production/ic_sms_24px.svg - icons/notification/svg/production/ic_sms_failed_24px.svg - icons/notification/svg/production/ic_sync_24px.svg - icons/notification/svg/production/ic_sync_disabled_24px.svg - icons/notification/svg/production/ic_sync_problem_24px.svg - icons/notification/svg/production/ic_system_update_24px.svg - icons/notification/svg/production/ic_tap_and_play_24px.svg - icons/notification/svg/production/ic_time_to_leave_24px.svg - icons/notification/svg/production/ic_vibration_24px.svg - icons/notification/svg/production/ic_voice_chat_24px.svg - icons/notification/svg/production/ic_vpn_lock_24px.svg - icons/notification/svg/production/ic_wc_24px.svg - icons/notification/svg/production/ic_wifi_24px.svg - icons/places/svg/production/ic_ac_unit_24px.svg - icons/places/svg/production/ic_airport_shuttle_24px.svg - icons/places/svg/production/ic_all_inclusive_24px.svg - icons/places/svg/production/ic_beach_access_24px.svg - icons/places/svg/production/ic_business_center_24px.svg - icons/places/svg/production/ic_casino_24px.svg - icons/places/svg/production/ic_child_care_24px.svg - icons/places/svg/production/ic_child_friendly_24px.svg - icons/places/svg/production/ic_fitness_center_24px.svg - icons/places/svg/production/ic_free_breakfast_24px.svg - icons/places/svg/production/ic_golf_course_24px.svg - icons/places/svg/production/ic_hot_tub_24px.svg - icons/places/svg/production/ic_kitchen_24px.svg - icons/places/svg/production/ic_pool_24px.svg - icons/places/svg/production/ic_room_service_24px.svg - icons/places/svg/production/ic_rv_hookup_24px.svg - icons/places/svg/production/ic_smoke_free_24px.svg - icons/places/svg/production/ic_smoking_rooms_24px.svg - icons/places/svg/production/ic_spa_24px.svg - icons/social/svg/production/ic_cake_24px.svg - icons/social/svg/production/ic_domain_24px.svg - icons/social/svg/production/ic_group_24px.svg - icons/social/svg/production/ic_group_add_24px.svg - icons/social/svg/production/ic_location_city_24px.svg - icons/social/svg/production/ic_mood_24px.svg - icons/social/svg/production/ic_mood_bad_24px.svg - icons/social/svg/production/ic_notifications_24px.svg - icons/social/svg/production/ic_notifications_active_24px.svg - icons/social/svg/production/ic_notifications_none_24px.svg - icons/social/svg/production/ic_notifications_off_24px.svg - icons/social/svg/production/ic_notifications_paused_24px.svg - icons/social/svg/production/ic_pages_24px.svg - icons/social/svg/production/ic_party_mode_24px.svg - icons/social/svg/production/ic_people_24px.svg - icons/social/svg/production/ic_people_outline_24px.svg - icons/social/svg/production/ic_person_24px.svg - icons/social/svg/production/ic_person_add_24px.svg - icons/social/svg/production/ic_person_outline_24px.svg - icons/social/svg/production/ic_plus_one_24px.svg - icons/social/svg/production/ic_poll_24px.svg - icons/social/svg/production/ic_public_24px.svg - icons/social/svg/production/ic_school_24px.svg - icons/social/svg/production/ic_sentiment_dissatisfied_24px.svg - icons/social/svg/production/ic_sentiment_neutral_24px.svg - icons/social/svg/production/ic_sentiment_satisfied_24px.svg - icons/social/svg/production/ic_sentiment_very_dissatisfied_24px.svg - icons/social/svg/production/ic_sentiment_very_satisfied_24px.svg - icons/social/svg/production/ic_share_24px.svg - icons/social/svg/production/ic_whatshot_24px.svg - - From b752e8a3ae8583d7bc04c5a03a6813b45612927a Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 01:26:24 +0100 Subject: [PATCH 03/46] Deleting *.pro files. --- components/components.pro | 130 -------------------------------------- qt-material-widgets.pro | 17 ----- 2 files changed, 147 deletions(-) delete mode 100644 components/components.pro delete mode 100644 qt-material-widgets.pro diff --git a/components/components.pro b/components/components.pro deleted file mode 100644 index d6080d5db..000000000 --- a/components/components.pro +++ /dev/null @@ -1,130 +0,0 @@ -TEMPLATE = lib -CONFIG += staticlib -SOURCES = \ - qtmaterialavatar.cpp \ - lib/qtmaterialstyle.cpp \ - lib/qtmaterialtheme.cpp \ - qtmaterialbadge.cpp \ - lib/qtmaterialoverlaywidget.cpp \ - qtmaterialcheckbox.cpp \ - lib/qtmaterialcheckable_internal.cpp \ - lib/qtmaterialcheckable.cpp \ - lib/qtmaterialripple.cpp \ - lib/qtmaterialrippleoverlay.cpp \ - qtmaterialfab.cpp \ - qtmaterialraisedbutton.cpp \ - qtmaterialflatbutton_internal.cpp \ - qtmaterialflatbutton.cpp \ - lib/qtmaterialstatetransition.cpp \ - qtmaterialiconbutton.cpp \ - qtmaterialprogress_internal.cpp \ - qtmaterialprogress.cpp \ - qtmaterialcircularprogress_internal.cpp \ - qtmaterialcircularprogress.cpp \ - qtmaterialslider_internal.cpp \ - qtmaterialslider.cpp \ - qtmaterialsnackbar_internal.cpp \ - qtmaterialsnackbar.cpp \ - qtmaterialradiobutton.cpp \ - qtmaterialtoggle_internal.cpp \ - qtmaterialtoggle.cpp \ - qtmaterialtextfield_internal.cpp \ - qtmaterialtextfield.cpp \ - qtmaterialtabs_internal.cpp \ - qtmaterialtabs.cpp \ - qtmaterialscrollbar_internal.cpp \ - qtmaterialscrollbar.cpp \ - qtmaterialdialog_internal.cpp \ - qtmaterialdialog.cpp \ - qtmaterialdrawer_internal.cpp \ - qtmaterialdrawer.cpp \ - qtmaterialappbar.cpp \ - qtmaterialautocomplete.cpp \ - qtmaterialpaper.cpp \ - qtmaterialtable.cpp \ - layouts/qtmaterialsnackbarlayout.cpp \ - qtmaterialautocomplete_internal.cpp \ - qtmaterialmenu.cpp \ - qtmaterialmenu_internal.cpp \ - qtmateriallist.cpp \ - qtmateriallistitem.cpp -HEADERS = \ - qtmaterialavatar_p.h \ - qtmaterialavatar.h \ - lib/qtmaterialstyle_p.h \ - lib/qtmaterialstyle.h \ - lib/qtmaterialtheme_p.h \ - lib/qtmaterialtheme.h \ - qtmaterialbadge_p.h \ - qtmaterialbadge.h \ - lib/qtmaterialoverlaywidget.h \ - qtmaterialcheckbox_p.h \ - qtmaterialcheckbox.h \ - lib/qtmaterialcheckable_internal.h \ - lib/qtmaterialcheckable_p.h \ - lib/qtmaterialripple.h \ - lib/qtmaterialrippleoverlay.h \ - lib/qtmaterialcheckable.h \ - qtmaterialfab_p.h \ - qtmaterialfab.h \ - qtmaterialraisedbutton_p.h \ - qtmaterialraisedbutton.h \ - qtmaterialflatbutton_internal.h \ - qtmaterialflatbutton_p.h \ - qtmaterialflatbutton.h \ - lib/qtmaterialstatetransition.h \ - lib/qtmaterialstatetransitionevent.h \ - qtmaterialiconbutton_p.h \ - qtmaterialiconbutton.h \ - qtmaterialprogress_internal.h \ - qtmaterialprogress_p.h \ - qtmaterialprogress.h \ - qtmaterialcircularprogress_internal.h \ - qtmaterialcircularprogress_p.h \ - qtmaterialcircularprogress.h \ - qtmaterialslider_internal.h \ - qtmaterialslider_p.h \ - qtmaterialslider.h \ - qtmaterialsnackbar_internal.h \ - qtmaterialsnackbar_p.h \ - qtmaterialsnackbar.h \ - qtmaterialradiobutton_p.h \ - qtmaterialradiobutton.h \ - qtmaterialtoggle_internal.h \ - qtmaterialtoggle_p.h \ - qtmaterialtoggle.h \ - qtmaterialtextfield_internal.h \ - qtmaterialtextfield_p.h \ - qtmaterialtextfield.h \ - qtmaterialtabs_internal.h \ - qtmaterialtabs_p.h \ - qtmaterialtabs.h \ - qtmaterialscrollbar_internal.h \ - qtmaterialscrollbar_p.h \ - qtmaterialscrollbar.h \ - qtmaterialdialog_internal.h \ - qtmaterialdialog_p.h \ - qtmaterialdialog.h \ - qtmaterialdrawer_internal.h \ - qtmaterialdrawer_p.h \ - qtmaterialdrawer.h \ - qtmaterialappbar.h \ - qtmaterialappbar_p.h \ - qtmaterialautocomplete.h \ - qtmaterialautocomplete_p.h \ - qtmaterialpaper.h \ - qtmaterialpaper_p.h \ - qtmaterialtable.h \ - qtmaterialtable_p.h \ - layouts/qtmaterialsnackbarlayout.h \ - layouts/qtmaterialsnackbarlayout_p.h \ - qtmaterialautocomplete_internal.h \ - qtmaterialmenu.h \ - qtmaterialmenu_p.h \ - qtmaterialmenu_internal.h \ - qtmateriallist.h \ - qtmateriallist_p.h \ - qtmateriallistitem.h \ - qtmateriallistitem_p.h -RESOURCES += \ - resources.qrc diff --git a/qt-material-widgets.pro b/qt-material-widgets.pro deleted file mode 100644 index 5654f10a8..000000000 --- a/qt-material-widgets.pro +++ /dev/null @@ -1,17 +0,0 @@ -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - -TARGET = qt-material-widgets -TEMPLATE = subdirs -SUBDIRS = components examples -CONFIG += ordered - -# The following define makes your compiler emit warnings if you use -# any feature of Qt which as been marked as deprecated (the exact warnings -# depend on your compiler). Please consult the documentation of the -# deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -# You can also make your code fail to compile if you use deprecated APIs. -# In order to do so, uncomment the following line. -# You can also select to disable deprecated APIs only up to a certain version of Qt. -#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 From 31a4a59a3fb7aeafc9e30f7112add6e995f9ab46 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 01:29:18 +0100 Subject: [PATCH 04/46] AppBar -> md namespace. Shorten the long, boring classes names. --- components/qtmaterialappbar.cpp | 45 ++++++++++++++++++--------------- components/qtmaterialappbar.h | 21 +++++++++------ components/qtmaterialappbar_p.h | 19 +++++++++----- 3 files changed, 49 insertions(+), 36 deletions(-) diff --git a/components/qtmaterialappbar.cpp b/components/qtmaterialappbar.cpp index 2170ca496..ac625abfd 100644 --- a/components/qtmaterialappbar.cpp +++ b/components/qtmaterialappbar.cpp @@ -4,6 +4,7 @@ #include #include "lib/qtmaterialstyle.h" +namespace md { /*! * \class QtMaterialAppBarPrivate * \internal @@ -12,7 +13,7 @@ /*! * \internal */ -QtMaterialAppBarPrivate::QtMaterialAppBarPrivate(QtMaterialAppBar *q) +AppBarPrivate::AppBarPrivate(AppBar *q) : q_ptr(q) { } @@ -20,16 +21,16 @@ QtMaterialAppBarPrivate::QtMaterialAppBarPrivate(QtMaterialAppBar *q) /*! * \internal */ -QtMaterialAppBarPrivate::~QtMaterialAppBarPrivate() +AppBarPrivate::~AppBarPrivate() { } /*! * \internal */ -void QtMaterialAppBarPrivate::init() +void AppBarPrivate::init() { - Q_Q(QtMaterialAppBar); + Q_Q(AppBar); useThemeColors = true; @@ -48,23 +49,23 @@ void QtMaterialAppBarPrivate::init() * \class QtMaterialAppBar */ -QtMaterialAppBar::QtMaterialAppBar(QWidget *parent) +AppBar::AppBar(QWidget *parent) : QWidget(parent), - d_ptr(new QtMaterialAppBarPrivate(this)) + d_ptr(new AppBarPrivate(this)) { d_func()->init(); } -QtMaterialAppBar::~QtMaterialAppBar() +AppBar::~AppBar() { } -QSize QtMaterialAppBar::sizeHint() const +QSize AppBar::sizeHint() const { return QSize(-1, 64); } -void QtMaterialAppBar::paintEvent(QPaintEvent *event) +void AppBar::paintEvent(QPaintEvent *event) { Q_UNUSED(event) @@ -73,9 +74,9 @@ void QtMaterialAppBar::paintEvent(QPaintEvent *event) painter.fillRect(rect(), backgroundColor()); } -void QtMaterialAppBar::setUseThemeColors(bool value) +void AppBar::setUseThemeColors(bool value) { - Q_D(QtMaterialAppBar); + Q_D(AppBar); if (d->useThemeColors == value) { return; @@ -85,16 +86,16 @@ void QtMaterialAppBar::setUseThemeColors(bool value) update(); } -bool QtMaterialAppBar::useThemeColors() const +bool AppBar::useThemeColors() const { - Q_D(const QtMaterialAppBar); + Q_D(const AppBar); return d->useThemeColors; } -void QtMaterialAppBar::setForegroundColor(const QColor &color) +void AppBar::setForegroundColor(const QColor &color) { - Q_D(QtMaterialAppBar); + Q_D(AppBar); d->foregroundColor = color; @@ -104,9 +105,9 @@ void QtMaterialAppBar::setForegroundColor(const QColor &color) update(); } -QColor QtMaterialAppBar::foregroundColor() const +QColor AppBar::foregroundColor() const { - Q_D(const QtMaterialAppBar); + Q_D(const AppBar); if (d->useThemeColors || !d->foregroundColor.isValid()) { return QtMaterialStyle::instance().themeColor("primary1"); @@ -115,9 +116,9 @@ QColor QtMaterialAppBar::foregroundColor() const } } -void QtMaterialAppBar::setBackgroundColor(const QColor &color) +void AppBar::setBackgroundColor(const QColor &color) { - Q_D(QtMaterialAppBar); + Q_D(AppBar); d->backgroundColor = color; @@ -127,9 +128,9 @@ void QtMaterialAppBar::setBackgroundColor(const QColor &color) update(); } -QColor QtMaterialAppBar::backgroundColor() const +QColor AppBar::backgroundColor() const { - Q_D(const QtMaterialAppBar); + Q_D(const AppBar); if (d->useThemeColors || !d->backgroundColor.isValid()) { return QtMaterialStyle::instance().themeColor("primary1"); @@ -137,3 +138,5 @@ QColor QtMaterialAppBar::backgroundColor() const return d->backgroundColor; } } + +} diff --git a/components/qtmaterialappbar.h b/components/qtmaterialappbar.h index 4c60564a3..8e7fb14b9 100644 --- a/components/qtmaterialappbar.h +++ b/components/qtmaterialappbar.h @@ -4,9 +4,12 @@ #include #include -class QtMaterialAppBarPrivate; +namespace md +{ + +class AppBarPrivate; -class QtMaterialAppBar : public QWidget +class AppBar : public QWidget { Q_OBJECT @@ -14,8 +17,8 @@ class QtMaterialAppBar : public QWidget Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor) public: - explicit QtMaterialAppBar(QWidget *parent = 0); - ~QtMaterialAppBar(); + explicit AppBar(QWidget *parent = 0); + ~AppBar(); QSize sizeHint() const Q_DECL_OVERRIDE; @@ -33,16 +36,18 @@ class QtMaterialAppBar : public QWidget protected: void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QtMaterialAppBar) - Q_DECLARE_PRIVATE(QtMaterialAppBar) + Q_DISABLE_COPY(AppBar) + Q_DECLARE_PRIVATE(AppBar) }; -inline QHBoxLayout *QtMaterialAppBar::appBarLayout() const +inline QHBoxLayout *AppBar::appBarLayout() const { return static_cast(layout()); } +} + #endif // QTMATERIALAPPBAR_H diff --git a/components/qtmaterialappbar_p.h b/components/qtmaterialappbar_p.h index 0586556b4..cd344cd7b 100644 --- a/components/qtmaterialappbar_p.h +++ b/components/qtmaterialappbar_p.h @@ -4,23 +4,28 @@ #include #include -class QtMaterialAppBar; +namespace md +{ + +class AppBar; -class QtMaterialAppBarPrivate +class AppBarPrivate { - Q_DISABLE_COPY(QtMaterialAppBarPrivate) - Q_DECLARE_PUBLIC(QtMaterialAppBar) + Q_DISABLE_COPY(AppBarPrivate) + Q_DECLARE_PUBLIC(AppBar) public: - QtMaterialAppBarPrivate(QtMaterialAppBar *q); - ~QtMaterialAppBarPrivate(); + AppBarPrivate(AppBar *q); + ~AppBarPrivate(); void init(); - QtMaterialAppBar *const q_ptr; + AppBar *const q_ptr; bool useThemeColors; QColor foregroundColor; QColor backgroundColor; }; +} + #endif // QTMATERIALAPPBAR_P_H From 14f4403bce6c2dcbec7af083b047b146d666c527 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 01:46:23 +0100 Subject: [PATCH 05/46] move "AutoComplete" classes into "md" namespace. --- components/qtmaterialautocomplete.cpp | 42 ++++++++++--------- components/qtmaterialautocomplete.h | 17 +++++--- .../qtmaterialautocomplete_internal.cpp | 8 +++- components/qtmaterialautocomplete_internal.h | 13 ++++-- components/qtmaterialautocomplete_p.h | 21 ++++++---- 5 files changed, 62 insertions(+), 39 deletions(-) diff --git a/components/qtmaterialautocomplete.cpp b/components/qtmaterialautocomplete.cpp index df006a68a..e14f242ae 100644 --- a/components/qtmaterialautocomplete.cpp +++ b/components/qtmaterialautocomplete.cpp @@ -9,6 +9,8 @@ #include "qtmaterialautocomplete_internal.h" #include "qtmaterialflatbutton.h" +namespace md +{ /*! * \class QtMaterialAutoCompletePrivate * \internal @@ -17,28 +19,28 @@ /*! * \internal */ -QtMaterialAutoCompletePrivate::QtMaterialAutoCompletePrivate(QtMaterialAutoComplete *q) - : QtMaterialTextFieldPrivate(q) +AutoCompletePrivate::AutoCompletePrivate(AutoComplete *q) + : TextFieldPrivate(q) { } /*! * \internal */ -QtMaterialAutoCompletePrivate::~QtMaterialAutoCompletePrivate() +AutoCompletePrivate::~AutoCompletePrivate() { } /*! * \internal */ -void QtMaterialAutoCompletePrivate::init() +void AutoCompletePrivate::init() { - Q_Q(QtMaterialAutoComplete); + Q_Q(AutoComplete); menu = new QWidget; frame = new QWidget; - stateMachine = new QtMaterialAutoCompleteStateMachine(menu); + stateMachine = new AutoCompleteStateMachine(menu); menuLayout = new QVBoxLayout; maxWidth = 0; @@ -71,27 +73,27 @@ void QtMaterialAutoCompletePrivate::init() * \class QtMaterialAutoComplete */ -QtMaterialAutoComplete::QtMaterialAutoComplete(QWidget *parent) - : QtMaterialTextField(*new QtMaterialAutoCompletePrivate(this), parent) +AutoComplete::AutoComplete(QWidget *parent) + : TextField(*new AutoCompletePrivate(this), parent) { d_func()->init(); } -QtMaterialAutoComplete::~QtMaterialAutoComplete() +AutoComplete::~AutoComplete() { } -void QtMaterialAutoComplete::setDataSource(const QStringList &data) +void AutoComplete::setDataSource(const QStringList &data) { - Q_D(QtMaterialAutoComplete); + Q_D(AutoComplete); d->dataSource = data; update(); } -void QtMaterialAutoComplete::updateResults(QString text) +void AutoComplete::updateResults(QString text) { - Q_D(QtMaterialAutoComplete); + Q_D(AutoComplete); QStringList results; QString trimmed(text.trimmed()); @@ -156,9 +158,9 @@ void QtMaterialAutoComplete::updateResults(QString text) d->menu->update(); } -bool QtMaterialAutoComplete::QtMaterialAutoComplete::event(QEvent *event) +bool AutoComplete::AutoComplete::event(QEvent *event) { - Q_D(QtMaterialAutoComplete); + Q_D(AutoComplete); switch (event->type()) { @@ -178,12 +180,12 @@ bool QtMaterialAutoComplete::QtMaterialAutoComplete::event(QEvent *event) default: break; } - return QtMaterialTextField::event(event); + return TextField::event(event); } -bool QtMaterialAutoComplete::eventFilter(QObject *watched, QEvent *event) +bool AutoComplete::eventFilter(QObject *watched, QEvent *event) { - Q_D(QtMaterialAutoComplete); + Q_D(AutoComplete); if (d->frame == watched) { @@ -238,5 +240,7 @@ bool QtMaterialAutoComplete::eventFilter(QObject *watched, QEvent *event) break; } } - return QtMaterialTextField::eventFilter(watched, event); + return TextField::eventFilter(watched, event); +} + } diff --git a/components/qtmaterialautocomplete.h b/components/qtmaterialautocomplete.h index 8b4686129..0e6a2347d 100644 --- a/components/qtmaterialautocomplete.h +++ b/components/qtmaterialautocomplete.h @@ -3,15 +3,18 @@ #include "qtmaterialtextfield.h" -class QtMaterialAutoCompletePrivate; +namespace md +{ + +class AutoCompletePrivate; -class QtMaterialAutoComplete : public QtMaterialTextField +class AutoComplete : public TextField { Q_OBJECT public: - explicit QtMaterialAutoComplete(QWidget *parent = 0); - ~QtMaterialAutoComplete(); + explicit AutoComplete(QWidget *parent = 0); + ~AutoComplete(); void setDataSource(const QStringList &data); @@ -26,8 +29,10 @@ protected slots: bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(QtMaterialAutoComplete) - Q_DECLARE_PRIVATE(QtMaterialAutoComplete) + Q_DISABLE_COPY(AutoComplete) + Q_DECLARE_PRIVATE(AutoComplete) }; +} + #endif // QTMATERIALAUTOCOMPLETE_H diff --git a/components/qtmaterialautocomplete_internal.cpp b/components/qtmaterialautocomplete_internal.cpp index e01848d8c..75c548ccd 100644 --- a/components/qtmaterialautocomplete_internal.cpp +++ b/components/qtmaterialautocomplete_internal.cpp @@ -4,6 +4,8 @@ #include #include +namespace md +{ /*! * \class QtMaterialAutoCompleteStateMachine * \internal @@ -12,7 +14,7 @@ /*! * \internal */ -QtMaterialAutoCompleteStateMachine::QtMaterialAutoCompleteStateMachine(QWidget *menu) +AutoCompleteStateMachine::AutoCompleteStateMachine(QWidget *menu) : QStateMachine(menu), m_menu(menu), m_closedState(new QState), @@ -64,6 +66,8 @@ QtMaterialAutoCompleteStateMachine::QtMaterialAutoCompleteStateMachine(QWidget * /*! * \internal */ -QtMaterialAutoCompleteStateMachine::~QtMaterialAutoCompleteStateMachine() +AutoCompleteStateMachine::~AutoCompleteStateMachine() { } + +} diff --git a/components/qtmaterialautocomplete_internal.h b/components/qtmaterialautocomplete_internal.h index 7e76bd520..0621eab5d 100644 --- a/components/qtmaterialautocomplete_internal.h +++ b/components/qtmaterialautocomplete_internal.h @@ -4,13 +4,16 @@ #include #include "qtmaterialautocomplete.h" -class QtMaterialAutoCompleteStateMachine : public QStateMachine +namespace md +{ + +class AutoCompleteStateMachine : public QStateMachine { Q_OBJECT public: - explicit QtMaterialAutoCompleteStateMachine(QWidget *menu); - ~QtMaterialAutoCompleteStateMachine(); + explicit AutoCompleteStateMachine(QWidget *menu); + ~AutoCompleteStateMachine(); signals: void shouldOpen(); @@ -18,7 +21,7 @@ class QtMaterialAutoCompleteStateMachine : public QStateMachine void shouldFade(); private: - Q_DISABLE_COPY(QtMaterialAutoCompleteStateMachine) + Q_DISABLE_COPY(AutoCompleteStateMachine) QWidget *const m_menu; QState *const m_closedState; @@ -26,4 +29,6 @@ class QtMaterialAutoCompleteStateMachine : public QStateMachine QState *const m_closingState; }; +} + #endif // QTMATERIALAUTOCOMPLETESTATEMACHINE_H diff --git a/components/qtmaterialautocomplete_p.h b/components/qtmaterialautocomplete_p.h index 4fd405be7..29dc8525a 100644 --- a/components/qtmaterialautocomplete_p.h +++ b/components/qtmaterialautocomplete_p.h @@ -3,28 +3,33 @@ #include "qtmaterialtextfield_p.h" +namespace md +{ + class QWidget; class QVBoxLayout; -class QtMaterialAutoCompleteOverlay; -class QtMaterialAutoCompleteStateMachine; +class AutoCompleteOverlay; +class AutoCompleteStateMachine; -class QtMaterialAutoCompletePrivate : public QtMaterialTextFieldPrivate +class AutoCompletePrivate : public TextFieldPrivate { - Q_DISABLE_COPY(QtMaterialAutoCompletePrivate) - Q_DECLARE_PUBLIC(QtMaterialAutoComplete) + Q_DISABLE_COPY(AutoCompletePrivate) + Q_DECLARE_PUBLIC(AutoComplete) public: - QtMaterialAutoCompletePrivate(QtMaterialAutoComplete *q); - virtual ~QtMaterialAutoCompletePrivate(); + AutoCompletePrivate(AutoComplete *q); + virtual ~AutoCompletePrivate(); void init(); QWidget *menu; QWidget *frame; - QtMaterialAutoCompleteStateMachine *stateMachine; + AutoCompleteStateMachine *stateMachine; QVBoxLayout *menuLayout; QStringList dataSource; int maxWidth; }; +} + #endif // QTMATERIALAUTOCOMPLETE_P_H From cce6e6f1cfc198169f87bc3cc656163ebb514e3b Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 01:53:19 +0100 Subject: [PATCH 06/46] Move Avatar => md namespace. --- components/qtmaterialavatar.cpp | 88 +++++++++++++++++---------------- components/qtmaterialavatar.h | 22 +++++---- components/qtmaterialavatar_p.h | 37 ++++++++------ 3 files changed, 79 insertions(+), 68 deletions(-) diff --git a/components/qtmaterialavatar.cpp b/components/qtmaterialavatar.cpp index e769f8f56..ab8c38d1a 100644 --- a/components/qtmaterialavatar.cpp +++ b/components/qtmaterialavatar.cpp @@ -4,6 +4,8 @@ #include #include "lib/qtmaterialstyle.h" +namespace md +{ /*! * \class QtMaterialAvatarPrivate * \internal @@ -12,7 +14,7 @@ /*! * \internal */ -QtMaterialAvatarPrivate::QtMaterialAvatarPrivate(QtMaterialAvatar *q) +AvatarPrivate::AvatarPrivate(Avatar *q) : q_ptr(q) { } @@ -20,16 +22,16 @@ QtMaterialAvatarPrivate::QtMaterialAvatarPrivate(QtMaterialAvatar *q) /*! * \internal */ -QtMaterialAvatarPrivate::~QtMaterialAvatarPrivate() +AvatarPrivate::~AvatarPrivate() { } /*! * \internal */ -void QtMaterialAvatarPrivate::init() +void AvatarPrivate::init() { - Q_Q(QtMaterialAvatar); + Q_Q(Avatar); size = 40; type = Material::LetterAvatar; @@ -48,47 +50,47 @@ void QtMaterialAvatarPrivate::init() * \class QtMaterialAvatar */ -QtMaterialAvatar::QtMaterialAvatar(QWidget *parent) +Avatar::Avatar(QWidget *parent) : QWidget(parent), - d_ptr(new QtMaterialAvatarPrivate(this)) + d_ptr(new AvatarPrivate(this)) { d_func()->init(); } -QtMaterialAvatar::QtMaterialAvatar(const QIcon &icon, QWidget *parent) +Avatar::Avatar(const QIcon &icon, QWidget *parent) : QWidget(parent), - d_ptr(new QtMaterialAvatarPrivate(this)) + d_ptr(new AvatarPrivate(this)) { d_func()->init(); setIcon(icon); } -QtMaterialAvatar::QtMaterialAvatar(const QChar &letter, QWidget *parent) +Avatar::Avatar(const QChar &letter, QWidget *parent) : QWidget(parent), - d_ptr(new QtMaterialAvatarPrivate(this)) + d_ptr(new AvatarPrivate(this)) { d_func()->init(); setLetter(letter); } -QtMaterialAvatar::QtMaterialAvatar(const QImage &image, QWidget *parent) +Avatar::Avatar(const QImage &image, QWidget *parent) : QWidget(parent), - d_ptr(new QtMaterialAvatarPrivate(this)) + d_ptr(new AvatarPrivate(this)) { d_func()->init(); setImage(image); } -QtMaterialAvatar::~QtMaterialAvatar() +Avatar::~Avatar() { } -void QtMaterialAvatar::setUseThemeColors(bool value) +void Avatar::setUseThemeColors(bool value) { - Q_D(QtMaterialAvatar); + Q_D(Avatar); if (d->useThemeColors == value) { return; @@ -98,16 +100,16 @@ void QtMaterialAvatar::setUseThemeColors(bool value) update(); } -bool QtMaterialAvatar::useThemeColors() const +bool Avatar::useThemeColors() const { - Q_D(const QtMaterialAvatar); + Q_D(const Avatar); return d->useThemeColors; } -void QtMaterialAvatar::setTextColor(const QColor &color) +void Avatar::setTextColor(const QColor &color) { - Q_D(QtMaterialAvatar); + Q_D(Avatar); d->textColor = color; @@ -115,9 +117,9 @@ void QtMaterialAvatar::setTextColor(const QColor &color) update(); } -QColor QtMaterialAvatar::textColor() const +QColor Avatar::textColor() const { - Q_D(const QtMaterialAvatar); + Q_D(const Avatar); if (d->useThemeColors || !d->textColor.isValid()) { return QtMaterialStyle::instance().themeColor("canvas"); @@ -126,19 +128,19 @@ QColor QtMaterialAvatar::textColor() const } } -void QtMaterialAvatar::setBackgroundColor(const QColor &color) +void Avatar::setBackgroundColor(const QColor &color) { - Q_D(QtMaterialAvatar); + Q_D(Avatar); d->backgroundColor = color; - + MATERIAL_DISABLE_THEME_COLORS update(); } -QColor QtMaterialAvatar::backgroundColor() const +QColor Avatar::backgroundColor() const { - Q_D(const QtMaterialAvatar); + Q_D(const Avatar); if (d->useThemeColors || !d->backgroundColor.isValid()) { return QtMaterialStyle::instance().themeColor("primary1"); @@ -150,16 +152,16 @@ QColor QtMaterialAvatar::backgroundColor() const /*! * \reimp */ -QSize QtMaterialAvatar::sizeHint() const +QSize Avatar::sizeHint() const { - Q_D(const QtMaterialAvatar); + Q_D(const Avatar); return QSize(d->size+2, d->size+2); } -void QtMaterialAvatar::setSize(int size) +void Avatar::setSize(int size) { - Q_D(QtMaterialAvatar); + Q_D(Avatar); d->size = size; @@ -176,25 +178,25 @@ void QtMaterialAvatar::setSize(int size) update(); } -int QtMaterialAvatar::size() const +int Avatar::size() const { - Q_D(const QtMaterialAvatar); + Q_D(const Avatar); return d->size; } -void QtMaterialAvatar::setLetter(const QChar &letter) +void Avatar::setLetter(const QChar &letter) { - Q_D(QtMaterialAvatar); + Q_D(Avatar); d->letter = letter; d->type = Material::LetterAvatar; update(); } -void QtMaterialAvatar::setImage(const QImage &image) +void Avatar::setImage(const QImage &image) { - Q_D(QtMaterialAvatar); + Q_D(Avatar); d->image = image; d->type = Material::ImageAvatar; @@ -205,18 +207,18 @@ void QtMaterialAvatar::setImage(const QImage &image) update(); } -void QtMaterialAvatar::setIcon(const QIcon &icon) +void Avatar::setIcon(const QIcon &icon) { - Q_D(QtMaterialAvatar); + Q_D(Avatar); d->icon = icon; d->type = Material::IconAvatar; update(); } -Material::AvatarType QtMaterialAvatar::type() const +Material::AvatarType Avatar::type() const { - Q_D(const QtMaterialAvatar); + Q_D(const Avatar); return d->type; } @@ -224,11 +226,11 @@ Material::AvatarType QtMaterialAvatar::type() const /*! * \reimp */ -void QtMaterialAvatar::paintEvent(QPaintEvent *event) +void Avatar::paintEvent(QPaintEvent *event) { Q_UNUSED(event) - Q_D(QtMaterialAvatar); + Q_D(Avatar); QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); @@ -292,3 +294,5 @@ void QtMaterialAvatar::paintEvent(QPaintEvent *event) break; } } + +} diff --git a/components/qtmaterialavatar.h b/components/qtmaterialavatar.h index 9b99ef22f..a118421df 100644 --- a/components/qtmaterialavatar.h +++ b/components/qtmaterialavatar.h @@ -4,18 +4,19 @@ #include #include "lib/qtmaterialtheme.h" -class QtMaterialAvatarPrivate; +namespace md { +class AvatarPrivate; -class QtMaterialAvatar : public QWidget +class Avatar : public QWidget { Q_OBJECT public: - explicit QtMaterialAvatar(QWidget *parent = 0); - explicit QtMaterialAvatar(const QIcon &icon, QWidget *parent = 0); - explicit QtMaterialAvatar(const QChar &letter, QWidget *parent = 0); - explicit QtMaterialAvatar(const QImage &image, QWidget *parent = 0); - ~QtMaterialAvatar(); + explicit Avatar(QWidget *parent = 0); + explicit Avatar(const QIcon &icon, QWidget *parent = 0); + explicit Avatar(const QChar &letter, QWidget *parent = 0); + explicit Avatar(const QImage &image, QWidget *parent = 0); + ~Avatar(); void setUseThemeColors(bool value); bool useThemeColors() const; @@ -40,11 +41,12 @@ class QtMaterialAvatar : public QWidget protected: void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QtMaterialAvatar) - Q_DECLARE_PRIVATE(QtMaterialAvatar) + Q_DISABLE_COPY(Avatar) + Q_DECLARE_PRIVATE(Avatar) }; +} #endif // QTMATERIALAVATAR_H diff --git a/components/qtmaterialavatar_p.h b/components/qtmaterialavatar_p.h index 44b378e10..4870d7700 100644 --- a/components/qtmaterialavatar_p.h +++ b/components/qtmaterialavatar_p.h @@ -9,29 +9,34 @@ #include #include "lib/qtmaterialtheme.h" -class QtMaterialAvatar; +namespace md +{ + +class Avatar; -class QtMaterialAvatarPrivate +class AvatarPrivate { - Q_DISABLE_COPY(QtMaterialAvatarPrivate) - Q_DECLARE_PUBLIC(QtMaterialAvatar) + Q_DISABLE_COPY(AvatarPrivate) + Q_DECLARE_PUBLIC(Avatar) public: - QtMaterialAvatarPrivate(QtMaterialAvatar *q); - ~QtMaterialAvatarPrivate(); + AvatarPrivate(Avatar *q); + ~AvatarPrivate(); void init(); - QtMaterialAvatar *const q_ptr; - int size; - Material::AvatarType type; - QChar letter; - QImage image; - QIcon icon; - QPixmap pixmap; - bool useThemeColors; - QColor textColor; - QColor backgroundColor; + Avatar *const q_ptr; + int size; + Material::AvatarType type; + QChar letter; + QImage image; + QIcon icon; + QPixmap pixmap; + bool useThemeColors; + QColor textColor; + QColor backgroundColor; }; +} + #endif // QTMATERIALAVATAR_P_H From 410bb72a2d8df67b144f2f9ed006c592a8cff84e Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 02:06:18 +0100 Subject: [PATCH 07/46] Move CirclarProgress => md namespace. --- components/qtmaterialcircularprogress.cpp | 69 ++++++++++--------- components/qtmaterialcircularprogress.h | 19 +++-- .../qtmaterialcircularprogress_internal.cpp | 9 ++- .../qtmaterialcircularprogress_internal.h | 26 ++++--- components/qtmaterialcircularprogress_p.h | 22 +++--- 5 files changed, 84 insertions(+), 61 deletions(-) diff --git a/components/qtmaterialcircularprogress.cpp b/components/qtmaterialcircularprogress.cpp index f38ef0167..641a2dfb9 100644 --- a/components/qtmaterialcircularprogress.cpp +++ b/components/qtmaterialcircularprogress.cpp @@ -7,25 +7,28 @@ #include "qtmaterialcircularprogress_internal.h" #include "lib/qtmaterialstyle.h" +namespace md +{ + /*! * \class QtMaterialCircularProgressPrivate * \internal */ -QtMaterialCircularProgressPrivate::QtMaterialCircularProgressPrivate(QtMaterialCircularProgress *q) +CircularProgressPrivate::CircularProgressPrivate(CircularProgress *q) : q_ptr(q) { } -QtMaterialCircularProgressPrivate::~QtMaterialCircularProgressPrivate() +CircularProgressPrivate::~CircularProgressPrivate() { } -void QtMaterialCircularProgressPrivate::init() +void CircularProgressPrivate::init() { - Q_Q(QtMaterialCircularProgress); + Q_Q(CircularProgress); - delegate = new QtMaterialCircularProgressDelegate(q); + delegate = new CircularProgressDelegate(q); progressType = Material::IndeterminateProgress; penWidth = 6.25; size = 64; @@ -81,35 +84,35 @@ void QtMaterialCircularProgressPrivate::init() * \class QtMaterialCircularProgress */ -QtMaterialCircularProgress::QtMaterialCircularProgress(QWidget *parent) +CircularProgress::CircularProgress(QWidget *parent) : QProgressBar(parent), - d_ptr(new QtMaterialCircularProgressPrivate(this)) + d_ptr(new CircularProgressPrivate(this)) { d_func()->init(); } -QtMaterialCircularProgress::~QtMaterialCircularProgress() +CircularProgress::~CircularProgress() { } -void QtMaterialCircularProgress::setProgressType(Material::ProgressType type) +void CircularProgress::setProgressType(Material::ProgressType type) { - Q_D(QtMaterialCircularProgress); + Q_D(CircularProgress); d->progressType = type; update(); } -Material::ProgressType QtMaterialCircularProgress::progressType() const +Material::ProgressType CircularProgress::progressType() const { - Q_D(const QtMaterialCircularProgress); + Q_D(const CircularProgress); return d->progressType; } -void QtMaterialCircularProgress::setUseThemeColors(bool value) +void CircularProgress::setUseThemeColors(bool value) { - Q_D(QtMaterialCircularProgress); + Q_D(CircularProgress); if (d->useThemeColors == value) { return; @@ -119,48 +122,48 @@ void QtMaterialCircularProgress::setUseThemeColors(bool value) update(); } -bool QtMaterialCircularProgress::useThemeColors() const +bool CircularProgress::useThemeColors() const { - Q_D(const QtMaterialCircularProgress); + Q_D(const CircularProgress); return d->useThemeColors; } -void QtMaterialCircularProgress::setLineWidth(qreal width) +void CircularProgress::setLineWidth(qreal width) { - Q_D(QtMaterialCircularProgress); + Q_D(CircularProgress); d->penWidth = width; update(); updateGeometry(); } -qreal QtMaterialCircularProgress::lineWidth() const +qreal CircularProgress::lineWidth() const { - Q_D(const QtMaterialCircularProgress); + Q_D(const CircularProgress); return d->penWidth; } -void QtMaterialCircularProgress::setSize(int size) +void CircularProgress::setSize(int size) { - Q_D(QtMaterialCircularProgress); + Q_D(CircularProgress); d->size = size; update(); updateGeometry(); } -int QtMaterialCircularProgress::size() const +int CircularProgress::size() const { - Q_D(const QtMaterialCircularProgress); + Q_D(const CircularProgress); return d->size; } -void QtMaterialCircularProgress::setColor(const QColor &color) +void CircularProgress::setColor(const QColor &color) { - Q_D(QtMaterialCircularProgress); + Q_D(CircularProgress); d->color = color; @@ -168,9 +171,9 @@ void QtMaterialCircularProgress::setColor(const QColor &color) update(); } -QColor QtMaterialCircularProgress::color() const +QColor CircularProgress::color() const { - Q_D(const QtMaterialCircularProgress); + Q_D(const CircularProgress); if (d->useThemeColors || !d->color.isValid()) { return QtMaterialStyle::instance().themeColor("primary1"); @@ -182,9 +185,9 @@ QColor QtMaterialCircularProgress::color() const /*! * \reimp */ -QSize QtMaterialCircularProgress::sizeHint() const +QSize CircularProgress::sizeHint() const { - Q_D(const QtMaterialCircularProgress); + Q_D(const CircularProgress); const qreal s = d->size+d->penWidth+8; return QSize(s, s); @@ -193,11 +196,11 @@ QSize QtMaterialCircularProgress::sizeHint() const /*! * \reimp */ -void QtMaterialCircularProgress::paintEvent(QPaintEvent *event) +void CircularProgress::paintEvent(QPaintEvent *event) { Q_UNUSED(event) - Q_D(QtMaterialCircularProgress); + Q_D(CircularProgress); QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); @@ -253,3 +256,5 @@ void QtMaterialCircularProgress::paintEvent(QPaintEvent *event) painter.drawPath(path); } } + +} diff --git a/components/qtmaterialcircularprogress.h b/components/qtmaterialcircularprogress.h index dfc306e16..3273f4a04 100644 --- a/components/qtmaterialcircularprogress.h +++ b/components/qtmaterialcircularprogress.h @@ -4,9 +4,12 @@ #include #include "lib/qtmaterialtheme.h" -class QtMaterialCircularProgressPrivate; +namespace md +{ + +class CircularProgressPrivate; -class QtMaterialCircularProgress : public QProgressBar +class CircularProgress : public QProgressBar { Q_OBJECT @@ -15,8 +18,8 @@ class QtMaterialCircularProgress : public QProgressBar Q_PROPERTY(QColor color WRITE setColor READ color) public: - explicit QtMaterialCircularProgress(QWidget *parent = 0); - ~QtMaterialCircularProgress(); + explicit CircularProgress(QWidget *parent = 0); + ~CircularProgress(); void setProgressType(Material::ProgressType type); Material::ProgressType progressType() const; @@ -38,11 +41,13 @@ class QtMaterialCircularProgress : public QProgressBar protected: void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QtMaterialCircularProgress) - Q_DECLARE_PRIVATE(QtMaterialCircularProgress) + Q_DISABLE_COPY(CircularProgress) + Q_DECLARE_PRIVATE(CircularProgress) }; +} + #endif // QTMATERIALCIRCULARPROGRESS_H diff --git a/components/qtmaterialcircularprogress_internal.cpp b/components/qtmaterialcircularprogress_internal.cpp index b11a25f1d..79a55b213 100644 --- a/components/qtmaterialcircularprogress_internal.cpp +++ b/components/qtmaterialcircularprogress_internal.cpp @@ -1,11 +1,14 @@ #include "qtmaterialcircularprogress_internal.h" +namespace md +{ + /*! * \class QtMaterialCircularProgressDelegate * \internal */ -QtMaterialCircularProgressDelegate::QtMaterialCircularProgressDelegate(QtMaterialCircularProgress *parent) +CircularProgressDelegate::CircularProgressDelegate(CircularProgress *parent) : QObject(parent), m_progress(parent), m_dashOffset(0), @@ -15,6 +18,8 @@ QtMaterialCircularProgressDelegate::QtMaterialCircularProgressDelegate(QtMateria Q_ASSERT(parent); } -QtMaterialCircularProgressDelegate::~QtMaterialCircularProgressDelegate() +CircularProgressDelegate::~CircularProgressDelegate() { } + +} diff --git a/components/qtmaterialcircularprogress_internal.h b/components/qtmaterialcircularprogress_internal.h index a05bd6371..41a5f6b24 100644 --- a/components/qtmaterialcircularprogress_internal.h +++ b/components/qtmaterialcircularprogress_internal.h @@ -3,8 +3,10 @@ #include #include "qtmaterialcircularprogress.h" +namespace md +{ -class QtMaterialCircularProgressDelegate : public QObject +class CircularProgressDelegate : public QObject { Q_OBJECT @@ -13,8 +15,8 @@ class QtMaterialCircularProgressDelegate : public QObject Q_PROPERTY(int angle WRITE setAngle READ angle) public: - QtMaterialCircularProgressDelegate(QtMaterialCircularProgress *parent); - ~QtMaterialCircularProgressDelegate(); + CircularProgressDelegate(CircularProgress *parent); + ~CircularProgressDelegate(); inline void setDashOffset(qreal offset); inline qreal dashOffset() const; @@ -26,45 +28,47 @@ class QtMaterialCircularProgressDelegate : public QObject inline int angle() const; private: - Q_DISABLE_COPY(QtMaterialCircularProgressDelegate) + Q_DISABLE_COPY(CircularProgressDelegate) - QtMaterialCircularProgress *const m_progress; + CircularProgress *const m_progress; qreal m_dashOffset; qreal m_dashLength; int m_angle; }; -inline void QtMaterialCircularProgressDelegate::setDashOffset(qreal offset) +inline void CircularProgressDelegate::setDashOffset(qreal offset) { m_dashOffset = offset; m_progress->update(); } -inline qreal QtMaterialCircularProgressDelegate::dashOffset() const +inline qreal CircularProgressDelegate::dashOffset() const { return m_dashOffset; } -inline void QtMaterialCircularProgressDelegate::setDashLength(qreal length) +inline void CircularProgressDelegate::setDashLength(qreal length) { m_dashLength = length; m_progress->update(); } -inline qreal QtMaterialCircularProgressDelegate::dashLength() const +inline qreal CircularProgressDelegate::dashLength() const { return m_dashLength; } -inline void QtMaterialCircularProgressDelegate::setAngle(int angle) +inline void CircularProgressDelegate::setAngle(int angle) { m_angle = angle; m_progress->update(); } -inline int QtMaterialCircularProgressDelegate::angle() const +inline int CircularProgressDelegate::angle() const { return m_angle; } +} + #endif // QTMATERIALCIRCULARPROGRESS_INTERNAL_H diff --git a/components/qtmaterialcircularprogress_p.h b/components/qtmaterialcircularprogress_p.h index 451bc9c4b..66a4592a5 100644 --- a/components/qtmaterialcircularprogress_p.h +++ b/components/qtmaterialcircularprogress_p.h @@ -3,23 +3,25 @@ #include #include "lib/qtmaterialtheme.h" +namespace md +{ -class QtMaterialCircularProgress; -class QtMaterialCircularProgressDelegate; +class CircularProgress; +class CircularProgressDelegate; -class QtMaterialCircularProgressPrivate +class CircularProgressPrivate { - Q_DISABLE_COPY(QtMaterialCircularProgressPrivate) - Q_DECLARE_PUBLIC(QtMaterialCircularProgress) + Q_DISABLE_COPY(CircularProgressPrivate) + Q_DECLARE_PUBLIC(CircularProgress) public: - QtMaterialCircularProgressPrivate(QtMaterialCircularProgress *q); - ~QtMaterialCircularProgressPrivate(); + CircularProgressPrivate(CircularProgress *q); + ~CircularProgressPrivate(); void init(); - QtMaterialCircularProgress *const q_ptr; - QtMaterialCircularProgressDelegate *delegate; + CircularProgress *const q_ptr; + CircularProgressDelegate *delegate; Material::ProgressType progressType; QColor color; qreal penWidth; @@ -27,4 +29,6 @@ class QtMaterialCircularProgressPrivate bool useThemeColors; }; +} + #endif // QTMATERIALCIRCULARPROGRESS_P_H From 8a55c8f1d6f45302872edd527067b7c8d6a6e2a0 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 02:18:04 +0100 Subject: [PATCH 08/46] Move "FlatButton" to "md" namespace. --- components/qtmaterialflatbutton.cpp | 215 ++++++++++--------- components/qtmaterialflatbutton.h | 24 ++- components/qtmaterialflatbutton_internal.cpp | 30 +-- components/qtmaterialflatbutton_internal.h | 25 ++- components/qtmaterialflatbutton_p.h | 25 ++- 5 files changed, 168 insertions(+), 151 deletions(-) diff --git a/components/qtmaterialflatbutton.cpp b/components/qtmaterialflatbutton.cpp index b9d84d7e2..b892aaa96 100644 --- a/components/qtmaterialflatbutton.cpp +++ b/components/qtmaterialflatbutton.cpp @@ -11,6 +11,8 @@ #include "lib/qtmaterialstyle.h" #include "qtmaterialflatbutton_internal.h" +namespace md +{ /*! * \class QtMaterialFlatButtonPrivate * \internal @@ -19,7 +21,7 @@ /*! * \internal */ -QtMaterialFlatButtonPrivate::QtMaterialFlatButtonPrivate(QtMaterialFlatButton *q) +FlatButtonPrivate::FlatButtonPrivate(FlatButton *q) : q_ptr(q) { } @@ -27,19 +29,19 @@ QtMaterialFlatButtonPrivate::QtMaterialFlatButtonPrivate(QtMaterialFlatButton *q /*! * \internal */ -QtMaterialFlatButtonPrivate::~QtMaterialFlatButtonPrivate() +FlatButtonPrivate::~FlatButtonPrivate() { } /*! * \internal */ -void QtMaterialFlatButtonPrivate::init() +void FlatButtonPrivate::init() { - Q_Q(QtMaterialFlatButton); + Q_Q(FlatButton); - rippleOverlay = new QtMaterialRippleOverlay(q); - stateMachine = new QtMaterialFlatButtonStateMachine(q); + rippleOverlay = new RippleOverlay(q); + stateMachine = new FlatButtonStateMachine(q); role = Material::Default; rippleStyle = Material::PositionedRipple; iconPlacement = Material::LeftIcon; @@ -75,27 +77,27 @@ void QtMaterialFlatButtonPrivate::init() * \class QtMaterialFlatButton */ -QtMaterialFlatButton::QtMaterialFlatButton(QWidget *parent, Material::ButtonPreset preset) +FlatButton::FlatButton(QWidget *parent, Material::ButtonPreset preset) : QPushButton(parent), - d_ptr(new QtMaterialFlatButtonPrivate(this)) + d_ptr(new FlatButtonPrivate(this)) { d_func()->init(); applyPreset(preset); } -QtMaterialFlatButton::QtMaterialFlatButton(const QString &text, QWidget *parent, Material::ButtonPreset preset) +FlatButton::FlatButton(const QString &text, QWidget *parent, Material::ButtonPreset preset) : QPushButton(text, parent), - d_ptr(new QtMaterialFlatButtonPrivate(this)) + d_ptr(new FlatButtonPrivate(this)) { d_func()->init(); applyPreset(preset); } -QtMaterialFlatButton::QtMaterialFlatButton(const QString &text, Material::Role role, QWidget *parent, Material::ButtonPreset preset) +FlatButton::FlatButton(const QString &text, Material::Role role, QWidget *parent, Material::ButtonPreset preset) : QPushButton(text, parent), - d_ptr(new QtMaterialFlatButtonPrivate(this)) + d_ptr(new FlatButtonPrivate(this)) { d_func()->init(); @@ -103,11 +105,11 @@ QtMaterialFlatButton::QtMaterialFlatButton(const QString &text, Material::Role r setRole(role); } -QtMaterialFlatButton::~QtMaterialFlatButton() +FlatButton::~FlatButton() { } -void QtMaterialFlatButton::applyPreset(Material::ButtonPreset preset) +void FlatButton::applyPreset(Material::ButtonPreset preset) { switch (preset) { @@ -124,9 +126,9 @@ void QtMaterialFlatButton::applyPreset(Material::ButtonPreset preset) } } -void QtMaterialFlatButton::setUseThemeColors(bool value) +void FlatButton::setUseThemeColors(bool value) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); if (d->useThemeColors == value) { return; @@ -136,31 +138,31 @@ void QtMaterialFlatButton::setUseThemeColors(bool value) d->stateMachine->setupProperties(); } -bool QtMaterialFlatButton::useThemeColors() const +bool FlatButton::useThemeColors() const { - Q_D(const QtMaterialFlatButton); + Q_D(const FlatButton); return d->useThemeColors; } -void QtMaterialFlatButton::setRole(Material::Role role) +void FlatButton::setRole(Material::Role role) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->role = role; d->stateMachine->setupProperties(); } -Material::Role QtMaterialFlatButton::role() const +Material::Role FlatButton::role() const { - Q_D(const QtMaterialFlatButton); + Q_D(const FlatButton); return d->role; } -void QtMaterialFlatButton::setForegroundColor(const QColor &color) +void FlatButton::setForegroundColor(const QColor &color) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->foregroundColor = color; @@ -168,9 +170,9 @@ void QtMaterialFlatButton::setForegroundColor(const QColor &color) update(); } -QColor QtMaterialFlatButton::foregroundColor() const +QColor FlatButton::foregroundColor() const { - Q_D(const QtMaterialFlatButton); + Q_D(const FlatButton); if (d->useThemeColors || !d->foregroundColor.isValid()) { @@ -191,9 +193,9 @@ QColor QtMaterialFlatButton::foregroundColor() const return d->foregroundColor; } -void QtMaterialFlatButton::setBackgroundColor(const QColor &color) +void FlatButton::setBackgroundColor(const QColor &color) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->backgroundColor = color; @@ -201,9 +203,9 @@ void QtMaterialFlatButton::setBackgroundColor(const QColor &color) update(); } -QColor QtMaterialFlatButton::backgroundColor() const +QColor FlatButton::backgroundColor() const { - Q_D(const QtMaterialFlatButton); + Q_D(const FlatButton); if (d->useThemeColors || !d->backgroundColor.isValid()) { @@ -221,9 +223,9 @@ QColor QtMaterialFlatButton::backgroundColor() const return d->backgroundColor; } -void QtMaterialFlatButton::setOverlayColor(const QColor &color) +void FlatButton::setOverlayColor(const QColor &color) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->overlayColor = color; @@ -233,9 +235,9 @@ void QtMaterialFlatButton::setOverlayColor(const QColor &color) update(); } -QColor QtMaterialFlatButton::overlayColor() const +QColor FlatButton::overlayColor() const { - Q_D(const QtMaterialFlatButton); + Q_D(const FlatButton); if (d->useThemeColors || !d->overlayColor.isValid()) { return foregroundColor(); @@ -243,9 +245,9 @@ QColor QtMaterialFlatButton::overlayColor() const return d->overlayColor; } -void QtMaterialFlatButton::setDisabledForegroundColor(const QColor &color) +void FlatButton::setDisabledForegroundColor(const QColor &color) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->disabledColor = color; @@ -253,9 +255,9 @@ void QtMaterialFlatButton::setDisabledForegroundColor(const QColor &color) update(); } -QColor QtMaterialFlatButton::disabledForegroundColor() const +QColor FlatButton::disabledForegroundColor() const { - Q_D(const QtMaterialFlatButton); + Q_D(const FlatButton); if (d->useThemeColors || !d->disabledColor.isValid()) { return QtMaterialStyle::instance().themeColor("disabled"); @@ -264,9 +266,9 @@ QColor QtMaterialFlatButton::disabledForegroundColor() const } } -void QtMaterialFlatButton::setDisabledBackgroundColor(const QColor &color) +void FlatButton::setDisabledBackgroundColor(const QColor &color) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->disabledBackgroundColor = color; @@ -274,9 +276,9 @@ void QtMaterialFlatButton::setDisabledBackgroundColor(const QColor &color) update(); } -QColor QtMaterialFlatButton::disabledBackgroundColor() const +QColor FlatButton::disabledBackgroundColor() const { - Q_D(const QtMaterialFlatButton); + Q_D(const FlatButton); if (d->useThemeColors || !d->disabledBackgroundColor.isValid()) { return QtMaterialStyle::instance().themeColor("disabled3"); @@ -285,9 +287,9 @@ QColor QtMaterialFlatButton::disabledBackgroundColor() const } } -void QtMaterialFlatButton::setFontSize(qreal size) +void FlatButton::setFontSize(qreal size) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->fontSize = size; @@ -298,159 +300,159 @@ void QtMaterialFlatButton::setFontSize(qreal size) update(); } -qreal QtMaterialFlatButton::fontSize() const +qreal FlatButton::fontSize() const { - Q_D(const QtMaterialFlatButton); + Q_D(const FlatButton); return d->fontSize; } -void QtMaterialFlatButton::setHaloVisible(bool visible) +void FlatButton::setHaloVisible(bool visible) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->haloVisible = visible; update(); } -bool QtMaterialFlatButton::isHaloVisible() const +bool FlatButton::isHaloVisible() const { - Q_D(const QtMaterialFlatButton); + Q_D(const FlatButton); return d->haloVisible; } -void QtMaterialFlatButton::setOverlayStyle(Material::OverlayStyle style) +void FlatButton::setOverlayStyle(Material::OverlayStyle style) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->overlayStyle = style; update(); } -Material::OverlayStyle QtMaterialFlatButton::overlayStyle() const +Material::OverlayStyle FlatButton::overlayStyle() const { - Q_D(const QtMaterialFlatButton); + Q_D(const FlatButton); return d->overlayStyle; } -void QtMaterialFlatButton::setRippleStyle(Material::RippleStyle style) +void FlatButton::setRippleStyle(Material::RippleStyle style) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->rippleStyle = style; } -Material::RippleStyle QtMaterialFlatButton::rippleStyle() const +Material::RippleStyle FlatButton::rippleStyle() const { - Q_D(const QtMaterialFlatButton); + Q_D(const FlatButton); return d->rippleStyle; } -void QtMaterialFlatButton::setIconPlacement(Material::ButtonIconPlacement placement) +void FlatButton::setIconPlacement(Material::ButtonIconPlacement placement) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->iconPlacement = placement; update(); } -Material::ButtonIconPlacement QtMaterialFlatButton::iconPlacement() const +Material::ButtonIconPlacement FlatButton::iconPlacement() const { - Q_D(const QtMaterialFlatButton); + Q_D(const FlatButton); return d->iconPlacement; } -void QtMaterialFlatButton::setCornerRadius(qreal radius) +void FlatButton::setCornerRadius(qreal radius) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->cornerRadius = radius; updateClipPath(); update(); } -qreal QtMaterialFlatButton::cornerRadius() const +qreal FlatButton::cornerRadius() const { - Q_D(const QtMaterialFlatButton); + Q_D(const FlatButton); return d->cornerRadius; } -void QtMaterialFlatButton::setBackgroundMode(Qt::BGMode mode) +void FlatButton::setBackgroundMode(Qt::BGMode mode) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->bgMode = mode; d->stateMachine->setupProperties(); } -Qt::BGMode QtMaterialFlatButton::backgroundMode() const +Qt::BGMode FlatButton::backgroundMode() const { - Q_D(const QtMaterialFlatButton); + Q_D(const FlatButton); return d->bgMode; } -void QtMaterialFlatButton::setBaseOpacity(qreal opacity) +void FlatButton::setBaseOpacity(qreal opacity) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->baseOpacity = opacity; d->stateMachine->setupProperties(); } -qreal QtMaterialFlatButton::baseOpacity() const +qreal FlatButton::baseOpacity() const { - Q_D(const QtMaterialFlatButton); + Q_D(const FlatButton); return d->baseOpacity; } -void QtMaterialFlatButton::setCheckable(bool value) +void FlatButton::setCheckable(bool value) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->stateMachine->updateCheckedStatus(); QPushButton::setCheckable(value); } -void QtMaterialFlatButton::setHasFixedRippleRadius(bool value) +void FlatButton::setHasFixedRippleRadius(bool value) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->useFixedRippleRadius = value; } -bool QtMaterialFlatButton::hasFixedRippleRadius() const +bool FlatButton::hasFixedRippleRadius() const { - Q_D(const QtMaterialFlatButton); + Q_D(const FlatButton); return d->useFixedRippleRadius; } -void QtMaterialFlatButton::setFixedRippleRadius(qreal radius) +void FlatButton::setFixedRippleRadius(qreal radius) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->fixedRippleRadius = radius; setHasFixedRippleRadius(true); } -void QtMaterialFlatButton::setTextAlignment(Qt::Alignment alignment) +void FlatButton::setTextAlignment(Qt::Alignment alignment) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->textAlignment = alignment; } -Qt::Alignment QtMaterialFlatButton::textAlignment() const +Qt::Alignment FlatButton::textAlignment() const { - Q_D(const QtMaterialFlatButton); + Q_D(const FlatButton); return d->textAlignment; } @@ -458,7 +460,7 @@ Qt::Alignment QtMaterialFlatButton::textAlignment() const /*! * \reimp */ -QSize QtMaterialFlatButton::sizeHint() const +QSize FlatButton::sizeHint() const { ensurePolished(); @@ -467,13 +469,13 @@ QSize QtMaterialFlatButton::sizeHint() const int w = 20 + label.width(); int h = label.height(); if (!icon().isNull()) { - w += iconSize().width() + QtMaterialFlatButton::IconPadding; + w += iconSize().width() + FlatButton::IconPadding; h = qMax(h, iconSize().height()); } return QSize(w, 20 + h); } -QtMaterialFlatButton::QtMaterialFlatButton(QtMaterialFlatButtonPrivate &d,QWidget *parent, Material::ButtonPreset preset) +FlatButton::FlatButton(FlatButtonPrivate &d,QWidget *parent, Material::ButtonPreset preset) : QPushButton(parent), d_ptr(&d) { @@ -485,9 +487,9 @@ QtMaterialFlatButton::QtMaterialFlatButton(QtMaterialFlatButtonPrivate &d,QWidge /*! * \reimp */ -void QtMaterialFlatButton::checkStateSet() +void FlatButton::checkStateSet() { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); d->stateMachine->updateCheckedStatus(); @@ -497,9 +499,9 @@ void QtMaterialFlatButton::checkStateSet() /*! * \reimp */ -void QtMaterialFlatButton::mousePressEvent(QMouseEvent *event) +void FlatButton::mousePressEvent(QMouseEvent *event) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); if (Material::NoRipple != d->rippleStyle) { @@ -535,16 +537,16 @@ void QtMaterialFlatButton::mousePressEvent(QMouseEvent *event) /*! * \reimp */ -void QtMaterialFlatButton::mouseReleaseEvent(QMouseEvent *event) +void FlatButton::mouseReleaseEvent(QMouseEvent *event) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); QPushButton::mouseReleaseEvent(event); d->stateMachine->updateCheckedStatus(); } -void QtMaterialFlatButton::resizeEvent(QResizeEvent *event) +void FlatButton::resizeEvent(QResizeEvent *event) { QPushButton::resizeEvent(event); @@ -554,11 +556,11 @@ void QtMaterialFlatButton::resizeEvent(QResizeEvent *event) /*! * \reimp */ -void QtMaterialFlatButton::paintEvent(QPaintEvent *event) +void FlatButton::paintEvent(QPaintEvent *event) { Q_UNUSED(event) - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); @@ -586,9 +588,9 @@ void QtMaterialFlatButton::paintEvent(QPaintEvent *event) /*! * \internal */ -void QtMaterialFlatButton::paintBackground(QPainter *painter) +void FlatButton::paintBackground(QPainter *painter) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); const qreal overlayOpacity = d->stateMachine->overlayOpacity(); const qreal checkedProgress = d->stateMachine->checkedOverlayProgress(); @@ -640,9 +642,9 @@ void QtMaterialFlatButton::paintBackground(QPainter *painter) /*! * \internal */ -void QtMaterialFlatButton::paintHalo(QPainter *painter) +void FlatButton::paintHalo(QPainter *painter) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); if (!d->haloVisible) { return; @@ -669,9 +671,9 @@ void QtMaterialFlatButton::paintHalo(QPainter *painter) /*! * \internal */ -void QtMaterialFlatButton::paintForeground(QPainter *painter) +void FlatButton::paintForeground(QPainter *painter) { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); if (isEnabled()) { painter->setPen(foregroundColor()); @@ -729,9 +731,9 @@ void QtMaterialFlatButton::paintForeground(QPainter *painter) /*! * \internal */ -void QtMaterialFlatButton::updateClipPath() +void FlatButton::updateClipPath() { - Q_D(QtMaterialFlatButton); + Q_D(FlatButton); const qreal radius = d->cornerRadius; @@ -739,3 +741,4 @@ void QtMaterialFlatButton::updateClipPath() path.addRoundedRect(rect(), radius, radius); d->rippleOverlay->setClipPath(path); } +} diff --git a/components/qtmaterialflatbutton.h b/components/qtmaterialflatbutton.h index a74ab6afb..48c945480 100644 --- a/components/qtmaterialflatbutton.h +++ b/components/qtmaterialflatbutton.h @@ -5,9 +5,11 @@ #include #include "lib/qtmaterialtheme.h" -class QtMaterialFlatButtonPrivate; +namespace md { -class QtMaterialFlatButton : public QPushButton +class FlatButtonPrivate; + +class FlatButton : public QPushButton { Q_OBJECT @@ -19,10 +21,10 @@ class QtMaterialFlatButton : public QPushButton Q_PROPERTY(qreal fontSize WRITE setFontSize READ fontSize) public: - explicit QtMaterialFlatButton(QWidget *parent = 0, Material::ButtonPreset preset = Material::FlatPreset); - explicit QtMaterialFlatButton(const QString &text, QWidget *parent = 0, Material::ButtonPreset preset = Material::FlatPreset); - QtMaterialFlatButton(const QString &text, Material::Role role, QWidget *parent = 0, Material::ButtonPreset preset = Material::FlatPreset); - ~QtMaterialFlatButton(); + explicit FlatButton(QWidget *parent = 0, Material::ButtonPreset preset = Material::FlatPreset); + explicit FlatButton(const QString &text, QWidget *parent = 0, Material::ButtonPreset preset = Material::FlatPreset); + FlatButton(const QString &text, Material::Role role, QWidget *parent = 0, Material::ButtonPreset preset = Material::FlatPreset); + ~FlatButton(); void applyPreset(Material::ButtonPreset preset); @@ -88,7 +90,7 @@ class QtMaterialFlatButton : public QPushButton IconPadding = 12 }; - QtMaterialFlatButton(QtMaterialFlatButtonPrivate &d, QWidget *parent = 0, Material::ButtonPreset preset = Material::FlatPreset); + FlatButton(FlatButtonPrivate &d, QWidget *parent = 0, Material::ButtonPreset preset = Material::FlatPreset); void checkStateSet() Q_DECL_OVERRIDE; void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; @@ -102,11 +104,13 @@ class QtMaterialFlatButton : public QPushButton virtual void updateClipPath(); - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QtMaterialFlatButton) - Q_DECLARE_PRIVATE(QtMaterialFlatButton) + Q_DISABLE_COPY(FlatButton) + Q_DECLARE_PRIVATE(FlatButton) }; +} + #endif // QTMATERIALFLATBUTTON_H diff --git a/components/qtmaterialflatbutton_internal.cpp b/components/qtmaterialflatbutton_internal.cpp index 0709a45f5..f9ceef317 100644 --- a/components/qtmaterialflatbutton_internal.cpp +++ b/components/qtmaterialflatbutton_internal.cpp @@ -6,12 +6,14 @@ #include "qtmaterialflatbutton.h" #include "lib/qtmaterialstatetransition.h" +namespace md +{ /*! * \class QtMaterialFlatButtonStateMachine * \internal */ -QtMaterialFlatButtonStateMachine::QtMaterialFlatButtonStateMachine(QtMaterialFlatButton *parent) +FlatButtonStateMachine::FlatButtonStateMachine(FlatButton *parent) : QStateMachine(parent), m_button(parent), m_topLevelState(new QState(QState::ParallelStates)), @@ -105,47 +107,47 @@ QtMaterialFlatButtonStateMachine::QtMaterialFlatButtonStateMachine(QtMaterialFla m_haloAnimation->setLoopCount(-1); } -QtMaterialFlatButtonStateMachine::~QtMaterialFlatButtonStateMachine() +FlatButtonStateMachine::~FlatButtonStateMachine() { } -void QtMaterialFlatButtonStateMachine::setOverlayOpacity(qreal opacity) +void FlatButtonStateMachine::setOverlayOpacity(qreal opacity) { m_overlayOpacity = opacity; m_button->update(); } -void QtMaterialFlatButtonStateMachine::setCheckedOverlayProgress(qreal progress) +void FlatButtonStateMachine::setCheckedOverlayProgress(qreal progress) { m_checkedOverlayProgress = progress; m_button->update(); } -void QtMaterialFlatButtonStateMachine::setHaloOpacity(qreal opacity) +void FlatButtonStateMachine::setHaloOpacity(qreal opacity) { m_haloOpacity = opacity; m_button->update(); } -void QtMaterialFlatButtonStateMachine::setHaloSize(qreal size) +void FlatButtonStateMachine::setHaloSize(qreal size) { m_haloSize = size; m_button->update(); } -void QtMaterialFlatButtonStateMachine::setHaloScaleFactor(qreal factor) +void FlatButtonStateMachine::setHaloScaleFactor(qreal factor) { m_haloScaleFactor = factor; m_button->update(); } -void QtMaterialFlatButtonStateMachine::startAnimations() +void FlatButtonStateMachine::startAnimations() { m_haloAnimation->start(); start(); } -void QtMaterialFlatButtonStateMachine::setupProperties() +void FlatButtonStateMachine::setupProperties() { QColor overlayColor; @@ -173,7 +175,7 @@ void QtMaterialFlatButtonStateMachine::setupProperties() m_button->update(); } -void QtMaterialFlatButtonStateMachine::updateCheckedStatus() +void FlatButtonStateMachine::updateCheckedStatus() { const bool checked = m_button->isChecked(); if (m_wasChecked != checked) { @@ -186,7 +188,7 @@ void QtMaterialFlatButtonStateMachine::updateCheckedStatus() } } -bool QtMaterialFlatButtonStateMachine::eventFilter(QObject *watched, +bool FlatButtonStateMachine::eventFilter(QObject *watched, QEvent *event) { if (QEvent::FocusIn == event->type()) { @@ -199,7 +201,7 @@ bool QtMaterialFlatButtonStateMachine::eventFilter(QObject *watched, return QStateMachine::eventFilter(watched, event); } -void QtMaterialFlatButtonStateMachine::addTransition(QObject *object, +void FlatButtonStateMachine::addTransition(QObject *object, QEvent::Type eventType, QState *fromState, QState *toState) @@ -207,7 +209,7 @@ void QtMaterialFlatButtonStateMachine::addTransition(QObject *object, addTransition(new QEventTransition(object, eventType), fromState, toState); } -void QtMaterialFlatButtonStateMachine::addTransition(QAbstractTransition *transition, +void FlatButtonStateMachine::addTransition(QAbstractTransition *transition, QState *fromState, QState *toState) { @@ -230,3 +232,5 @@ void QtMaterialFlatButtonStateMachine::addTransition(QAbstractTransition *transi fromState->addTransition(transition); } + +} diff --git a/components/qtmaterialflatbutton_internal.h b/components/qtmaterialflatbutton_internal.h index ff93972b9..bf2361bcd 100644 --- a/components/qtmaterialflatbutton_internal.h +++ b/components/qtmaterialflatbutton_internal.h @@ -4,10 +4,12 @@ #include #include -class QtMaterialFlatButton; +namespace md +{ +class FlatButton; class QSequentialAnimationGroup; -class QtMaterialFlatButtonStateMachine : public QStateMachine +class FlatButtonStateMachine : public QStateMachine { Q_OBJECT @@ -18,8 +20,8 @@ class QtMaterialFlatButtonStateMachine : public QStateMachine Q_PROPERTY(qreal haloScaleFactor WRITE setHaloScaleFactor READ haloScaleFactor) public: - explicit QtMaterialFlatButtonStateMachine(QtMaterialFlatButton *parent); - ~QtMaterialFlatButtonStateMachine(); + explicit FlatButtonStateMachine(FlatButton *parent); + ~FlatButtonStateMachine(); void setOverlayOpacity(qreal opacity); inline qreal overlayOpacity() const; @@ -49,12 +51,12 @@ class QtMaterialFlatButtonStateMachine : public QStateMachine bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(QtMaterialFlatButtonStateMachine) + Q_DISABLE_COPY(FlatButtonStateMachine) void addTransition(QObject *object, QEvent::Type eventType, QState *fromState, QState *toState); void addTransition(QAbstractTransition *transition, QState *fromState, QState *toState); - QtMaterialFlatButton *const m_button; + FlatButton *const m_button; QState *const m_topLevelState; QState *const m_configState; QState *const m_checkableState; @@ -75,29 +77,30 @@ class QtMaterialFlatButtonStateMachine : public QStateMachine bool m_wasChecked; }; -inline qreal QtMaterialFlatButtonStateMachine::overlayOpacity() const +inline qreal FlatButtonStateMachine::overlayOpacity() const { return m_overlayOpacity; } -inline qreal QtMaterialFlatButtonStateMachine::checkedOverlayProgress() const +inline qreal FlatButtonStateMachine::checkedOverlayProgress() const { return m_checkedOverlayProgress; } -inline qreal QtMaterialFlatButtonStateMachine::haloOpacity() const +inline qreal FlatButtonStateMachine::haloOpacity() const { return m_haloOpacity; } -inline qreal QtMaterialFlatButtonStateMachine::haloSize() const +inline qreal FlatButtonStateMachine::haloSize() const { return m_haloSize; } -inline qreal QtMaterialFlatButtonStateMachine::haloScaleFactor() const +inline qreal FlatButtonStateMachine::haloScaleFactor() const { return m_haloScaleFactor; } +} #endif // QTMATERIALFLATBUTTON_INTERNAL_H diff --git a/components/qtmaterialflatbutton_p.h b/components/qtmaterialflatbutton_p.h index 1ab3d226f..1e5c899e2 100644 --- a/components/qtmaterialflatbutton_p.h +++ b/components/qtmaterialflatbutton_p.h @@ -5,24 +5,26 @@ #include #include "lib/qtmaterialtheme.h" -class QtMaterialFlatButton; -class QtMaterialRippleOverlay; -class QtMaterialFlatButtonStateMachine; +namespace md +{ +class FlatButton; +class RippleOverlay; +class FlatButtonStateMachine; -class QtMaterialFlatButtonPrivate +class FlatButtonPrivate { - Q_DISABLE_COPY(QtMaterialFlatButtonPrivate) - Q_DECLARE_PUBLIC(QtMaterialFlatButton) + Q_DISABLE_COPY(FlatButtonPrivate) + Q_DECLARE_PUBLIC(FlatButton) public: - QtMaterialFlatButtonPrivate(QtMaterialFlatButton *q); - virtual ~QtMaterialFlatButtonPrivate(); + FlatButtonPrivate(FlatButton *q); + virtual ~FlatButtonPrivate(); void init(); - QtMaterialFlatButton *const q_ptr; - QtMaterialRippleOverlay *rippleOverlay; - QtMaterialFlatButtonStateMachine *stateMachine; + FlatButton *const q_ptr; + RippleOverlay *rippleOverlay; + FlatButtonStateMachine *stateMachine; Material::Role role; Material::RippleStyle rippleStyle; Material::ButtonIconPlacement iconPlacement; @@ -42,5 +44,6 @@ class QtMaterialFlatButtonPrivate bool useFixedRippleRadius; bool haloVisible; }; +} #endif // QTMATERIALFLATBUTTON_P_H From 792f3cfa24b9767cfe6ed1a16827b34133439396 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 02:23:36 +0100 Subject: [PATCH 09/46] IconButton => md --- components/qtmaterialiconbutton.cpp | 66 +++++++++++++++-------------- components/qtmaterialiconbutton.h | 21 +++++---- components/qtmaterialiconbutton_p.h | 23 ++++++---- 3 files changed, 62 insertions(+), 48 deletions(-) diff --git a/components/qtmaterialiconbutton.cpp b/components/qtmaterialiconbutton.cpp index 525d6b206..9fbe4572a 100644 --- a/components/qtmaterialiconbutton.cpp +++ b/components/qtmaterialiconbutton.cpp @@ -5,25 +5,27 @@ #include "lib/qtmaterialstyle.h" #include "lib/qtmaterialrippleoverlay.h" +namespace md +{ /*! * \class QtMaterialIconButtonPrivate * \internal */ -QtMaterialIconButtonPrivate::QtMaterialIconButtonPrivate(QtMaterialIconButton *q) +IconButtonPrivate::IconButtonPrivate(IconButton *q) : q_ptr(q) { } -QtMaterialIconButtonPrivate::~QtMaterialIconButtonPrivate() +IconButtonPrivate::~IconButtonPrivate() { } -void QtMaterialIconButtonPrivate::init() +void IconButtonPrivate::init() { - Q_Q(QtMaterialIconButton); + Q_Q(IconButton); - rippleOverlay = new QtMaterialRippleOverlay(q->parentWidget()); + rippleOverlay = new RippleOverlay(q->parentWidget()); useThemeColors = true; rippleOverlay->installEventFilter(q); @@ -35,9 +37,9 @@ void QtMaterialIconButtonPrivate::init() q->setSizePolicy(policy); } -void QtMaterialIconButtonPrivate::updateRipple() +void IconButtonPrivate::updateRipple() { - Q_Q(QtMaterialIconButton); + Q_Q(IconButton); QRect r(q->rect()); r.setSize(QSize(q->width()*2, q->height()*2)); @@ -49,30 +51,30 @@ void QtMaterialIconButtonPrivate::updateRipple() * \class QtMaterialIconButton */ -QtMaterialIconButton::QtMaterialIconButton(const QIcon &icon, QWidget *parent) +IconButton::IconButton(const QIcon &icon, QWidget *parent) : QAbstractButton(parent), - d_ptr(new QtMaterialIconButtonPrivate(this)) + d_ptr(new IconButtonPrivate(this)) { d_func()->init(); setIcon(icon); } -QtMaterialIconButton::~QtMaterialIconButton() +IconButton::~IconButton() { } /*! * \reimp */ -QSize QtMaterialIconButton::sizeHint() const +QSize IconButton::sizeHint() const { return iconSize(); } -void QtMaterialIconButton::setUseThemeColors(bool value) +void IconButton::setUseThemeColors(bool value) { - Q_D(QtMaterialIconButton); + Q_D(IconButton); if (d->useThemeColors == value) { return; @@ -82,16 +84,16 @@ void QtMaterialIconButton::setUseThemeColors(bool value) update(); } -bool QtMaterialIconButton::useThemeColors() const +bool IconButton::useThemeColors() const { - Q_D(const QtMaterialIconButton); + Q_D(const IconButton); return d->useThemeColors; } -void QtMaterialIconButton::setColor(const QColor &color) +void IconButton::setColor(const QColor &color) { - Q_D(QtMaterialIconButton); + Q_D(IconButton); d->color = color; @@ -99,9 +101,9 @@ void QtMaterialIconButton::setColor(const QColor &color) update(); } -QColor QtMaterialIconButton::color() const +QColor IconButton::color() const { - Q_D(const QtMaterialIconButton); + Q_D(const IconButton); if (d->useThemeColors || !d->color.isValid()) { return QtMaterialStyle::instance().themeColor("text"); @@ -109,9 +111,9 @@ QColor QtMaterialIconButton::color() const return d->color; } -void QtMaterialIconButton::setDisabledColor(const QColor &color) +void IconButton::setDisabledColor(const QColor &color) { - Q_D(QtMaterialIconButton); + Q_D(IconButton); d->disabledColor = color; @@ -119,9 +121,9 @@ void QtMaterialIconButton::setDisabledColor(const QColor &color) update(); } -QColor QtMaterialIconButton::disabledColor() const +QColor IconButton::disabledColor() const { - Q_D(const QtMaterialIconButton); + Q_D(const IconButton); if (d->useThemeColors || !d->disabledColor.isValid()) { return QtMaterialStyle::instance().themeColor("disabled"); @@ -129,7 +131,7 @@ QColor QtMaterialIconButton::disabledColor() const return d->disabledColor; } -QtMaterialIconButton::QtMaterialIconButton(QtMaterialIconButtonPrivate &d, QWidget *parent) +IconButton::IconButton(IconButtonPrivate &d, QWidget *parent) : QAbstractButton(parent), d_ptr(&d) { @@ -139,9 +141,9 @@ QtMaterialIconButton::QtMaterialIconButton(QtMaterialIconButtonPrivate &d, QWidg /*! * \reimp */ -bool QtMaterialIconButton::event(QEvent *event) +bool IconButton::event(QEvent *event) { - Q_D(QtMaterialIconButton); + Q_D(IconButton); switch (event->type()) { @@ -165,11 +167,11 @@ bool QtMaterialIconButton::event(QEvent *event) /*! * \reimp */ -bool QtMaterialIconButton::eventFilter(QObject *obj, QEvent *event) +bool IconButton::eventFilter(QObject *obj, QEvent *event) { if (QEvent::Resize == event->type()) { - Q_D(QtMaterialIconButton); + Q_D(IconButton); d->updateRipple(); } @@ -179,9 +181,9 @@ bool QtMaterialIconButton::eventFilter(QObject *obj, QEvent *event) /*! * \reimp */ -void QtMaterialIconButton::mousePressEvent(QMouseEvent *event) +void IconButton::mousePressEvent(QMouseEvent *event) { - Q_D(QtMaterialIconButton); + Q_D(IconButton); d->rippleOverlay->addRipple(QPoint(d->rippleOverlay->width(), d->rippleOverlay->height())/2, @@ -194,7 +196,7 @@ void QtMaterialIconButton::mousePressEvent(QMouseEvent *event) /*! * \reimp */ -void QtMaterialIconButton::paintEvent(QPaintEvent *event) +void IconButton::paintEvent(QPaintEvent *event) { Q_UNUSED(event) @@ -210,3 +212,5 @@ void QtMaterialIconButton::paintEvent(QPaintEvent *event) const qreal h = pixmap.height(); painter.drawPixmap(QRect((r.width()-w)/2, (r.height()-h)/2, w, h), pixmap); } + +} diff --git a/components/qtmaterialiconbutton.h b/components/qtmaterialiconbutton.h index 5c2afc47b..1495743cd 100644 --- a/components/qtmaterialiconbutton.h +++ b/components/qtmaterialiconbutton.h @@ -3,15 +3,18 @@ #include -class QtMaterialIconButtonPrivate; +namespace md +{ + +class IconButtonPrivate; -class QtMaterialIconButton : public QAbstractButton +class IconButton : public QAbstractButton { Q_OBJECT public: - explicit QtMaterialIconButton(const QIcon &icon, QWidget *parent = 0); - ~QtMaterialIconButton(); + explicit IconButton(const QIcon &icon, QWidget *parent = 0); + ~IconButton(); QSize sizeHint() const Q_DECL_OVERRIDE; @@ -25,18 +28,20 @@ class QtMaterialIconButton : public QAbstractButton QColor disabledColor() const; protected: - QtMaterialIconButton(QtMaterialIconButtonPrivate &d, QWidget *parent = 0); + IconButton(IconButtonPrivate &d, QWidget *parent = 0); bool event(QEvent *event) Q_DECL_OVERRIDE; bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE; void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QtMaterialIconButton) - Q_DECLARE_PRIVATE(QtMaterialIconButton) + Q_DISABLE_COPY(IconButton) + Q_DECLARE_PRIVATE(IconButton) }; +} + #endif // QTMATERIALICONBUTTON_H diff --git a/components/qtmaterialiconbutton_p.h b/components/qtmaterialiconbutton_p.h index a532abca6..42d071e6d 100644 --- a/components/qtmaterialiconbutton_p.h +++ b/components/qtmaterialiconbutton_p.h @@ -3,27 +3,32 @@ #include -class QtMaterialIconButton; -class QtMaterialRippleOverlay; + +namespace md +{ +class IconButton; +class RippleOverlay; class QColor; -class QtMaterialIconButtonPrivate +class IconButtonPrivate { - Q_DISABLE_COPY(QtMaterialIconButtonPrivate) - Q_DECLARE_PUBLIC(QtMaterialIconButton) + Q_DISABLE_COPY(IconButtonPrivate) + Q_DECLARE_PUBLIC(IconButton) public: - QtMaterialIconButtonPrivate(QtMaterialIconButton *q); - virtual ~QtMaterialIconButtonPrivate(); + IconButtonPrivate(IconButton *q); + virtual ~IconButtonPrivate(); void init(); void updateRipple(); - QtMaterialIconButton *const q_ptr; - QtMaterialRippleOverlay *rippleOverlay; + IconButton *const q_ptr; + RippleOverlay *rippleOverlay; QColor color; QColor disabledColor; bool useThemeColors; }; +} + #endif // QTMATERIALICONBUTTON_P_H From d11d642cfe4aec4b7a5784a4b62d226f350c25bc Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 02:30:43 +0100 Subject: [PATCH 10/46] Menu => md namespace. --- components/qtmaterialmenu.cpp | 10 ++++++++-- components/qtmaterialmenu.h | 9 ++++++--- components/qtmaterialmenu_internal.cpp | 6 ++++++ components/qtmaterialmenu_internal.h | 3 +++ components/qtmaterialmenu_p.h | 3 +++ 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/components/qtmaterialmenu.cpp b/components/qtmaterialmenu.cpp index 5808a99e0..a6ff169f5 100644 --- a/components/qtmaterialmenu.cpp +++ b/components/qtmaterialmenu.cpp @@ -1,11 +1,17 @@ #include "qtmaterialmenu.h" #include "qtmaterialmenu_p.h" -QtMaterialMenu::QtMaterialMenu(QWidget *parent) +namespace md +{ + +Menu::Menu(QWidget *parent) : QWidget(parent) { } -QtMaterialMenu::~QtMaterialMenu() +Menu::~Menu() { } + +} + diff --git a/components/qtmaterialmenu.h b/components/qtmaterialmenu.h index beb01b5b9..c466c89f0 100644 --- a/components/qtmaterialmenu.h +++ b/components/qtmaterialmenu.h @@ -3,13 +3,16 @@ #include -class QtMaterialMenu : public QWidget +namespace md +{ +class Menu : public QWidget { Q_OBJECT public: - explicit QtMaterialMenu(QWidget *parent = 0); - ~QtMaterialMenu(); + explicit Menu(QWidget *parent = 0); + ~Menu(); }; +} #endif // QTMATERIALMENU_H diff --git a/components/qtmaterialmenu_internal.cpp b/components/qtmaterialmenu_internal.cpp index e69de29bb..686a80245 100644 --- a/components/qtmaterialmenu_internal.cpp +++ b/components/qtmaterialmenu_internal.cpp @@ -0,0 +1,6 @@ + + +namespace md +{ + +} diff --git a/components/qtmaterialmenu_internal.h b/components/qtmaterialmenu_internal.h index fb792356d..f9a77f10c 100644 --- a/components/qtmaterialmenu_internal.h +++ b/components/qtmaterialmenu_internal.h @@ -1,4 +1,7 @@ #ifndef QTMATERIALMENU_INTERNAL_H #define QTMATERIALMENU_INTERNAL_H +namespace md +{ +} #endif // QTMATERIALMENU_INTERNAL_H diff --git a/components/qtmaterialmenu_p.h b/components/qtmaterialmenu_p.h index 1328bdca1..7787c6e85 100644 --- a/components/qtmaterialmenu_p.h +++ b/components/qtmaterialmenu_p.h @@ -1,4 +1,7 @@ #ifndef QTMATERIALMENU_P_H #define QTMATERIALMENU_P_H +namespace md +{ +} #endif // QTMATERIALMENU_P_H From 9dff79d009590349b1db49b056316fbe19dfcc69 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 02:38:22 +0100 Subject: [PATCH 11/46] Empty classes [not implemented yet]. --- components/qtmaterialpaper.cpp | 5 +++++ components/qtmaterialpaper.h | 3 +++ components/qtmaterialpaper_p.h | 3 +++ components/qtmaterialtable.cpp | 4 ++++ components/qtmaterialtable.h | 3 +++ components/qtmaterialtable_p.h | 3 +++ 6 files changed, 21 insertions(+) diff --git a/components/qtmaterialpaper.cpp b/components/qtmaterialpaper.cpp index ad7dfa093..b0873f568 100644 --- a/components/qtmaterialpaper.cpp +++ b/components/qtmaterialpaper.cpp @@ -1,2 +1,7 @@ #include "qtmaterialpaper.h" #include "qtmaterialpaper_p.h" + +namespace md +{ + +} diff --git a/components/qtmaterialpaper.h b/components/qtmaterialpaper.h index f305836bd..187a9efdf 100644 --- a/components/qtmaterialpaper.h +++ b/components/qtmaterialpaper.h @@ -1,4 +1,7 @@ #ifndef QTMATERIALPAPER_H #define QTMATERIALPAPER_H +namespace md +{ +} #endif // QTMATERIALPAPER_H diff --git a/components/qtmaterialpaper_p.h b/components/qtmaterialpaper_p.h index 65972a653..5dd3d4978 100644 --- a/components/qtmaterialpaper_p.h +++ b/components/qtmaterialpaper_p.h @@ -1,4 +1,7 @@ #ifndef QTMATERIALPAPER_P_H #define QTMATERIALPAPER_P_H +namespace md +{ +} #endif // QTMATERIALPAPER_P_H diff --git a/components/qtmaterialtable.cpp b/components/qtmaterialtable.cpp index 171c04aa6..7b284aa14 100644 --- a/components/qtmaterialtable.cpp +++ b/components/qtmaterialtable.cpp @@ -1,2 +1,6 @@ #include "qtmaterialtable.h" #include "qtmaterialtable_p.h" +namespace md +{ + +} diff --git a/components/qtmaterialtable.h b/components/qtmaterialtable.h index b8953fab9..26f546558 100644 --- a/components/qtmaterialtable.h +++ b/components/qtmaterialtable.h @@ -1,4 +1,7 @@ #ifndef QTMATERIALTABLE_H #define QTMATERIALTABLE_H +namespace md +{ +} #endif // QTMATERIALTABLE_H diff --git a/components/qtmaterialtable_p.h b/components/qtmaterialtable_p.h index d3232a0f4..a4c470e46 100644 --- a/components/qtmaterialtable_p.h +++ b/components/qtmaterialtable_p.h @@ -1,4 +1,7 @@ #ifndef QTMATERIALTABLE_P_H #define QTMATERIALTABLE_P_H +namespace md +{ +} #endif // QTMATERIALTABLE_P_H From c71884d83bc008ea683fd524c8266b48f8b2190a Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 02:41:29 +0100 Subject: [PATCH 12/46] Empty class. --- components/layouts/qtmaterialsnackbarlayout.cpp | 4 ++++ components/layouts/qtmaterialsnackbarlayout.h | 3 +++ components/layouts/qtmaterialsnackbarlayout_p.h | 3 +++ 3 files changed, 10 insertions(+) diff --git a/components/layouts/qtmaterialsnackbarlayout.cpp b/components/layouts/qtmaterialsnackbarlayout.cpp index e69de29bb..a18b06bb9 100644 --- a/components/layouts/qtmaterialsnackbarlayout.cpp +++ b/components/layouts/qtmaterialsnackbarlayout.cpp @@ -0,0 +1,4 @@ +namespace md +{ + +} diff --git a/components/layouts/qtmaterialsnackbarlayout.h b/components/layouts/qtmaterialsnackbarlayout.h index c194fec81..274166bcf 100644 --- a/components/layouts/qtmaterialsnackbarlayout.h +++ b/components/layouts/qtmaterialsnackbarlayout.h @@ -1,4 +1,7 @@ #ifndef QTMATERIALSNACKBARLAYOUT_H #define QTMATERIALSNACKBARLAYOUT_H +namespace md +{ +} #endif // QTMATERIALSNACKBARLAYOUT_H diff --git a/components/layouts/qtmaterialsnackbarlayout_p.h b/components/layouts/qtmaterialsnackbarlayout_p.h index 6c2dd5dcf..570f62c49 100644 --- a/components/layouts/qtmaterialsnackbarlayout_p.h +++ b/components/layouts/qtmaterialsnackbarlayout_p.h @@ -1,4 +1,7 @@ #ifndef QTMATERIALSNACKBARLAYOUT_P_H #define QTMATERIALSNACKBARLAYOUT_P_H +namespace md +{ +} #endif // QTMATERIALSNACKBARLAYOUT_P_H From 49778ebc243ea8af1da0c51d370845bffb8d2aee Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 02:59:33 +0100 Subject: [PATCH 13/46] The base classes moved to md namespace. --- components/lib/qtmaterialcheckable.cpp | 134 +++++++++--------- components/lib/qtmaterialcheckable.h | 20 +-- .../lib/qtmaterialcheckable_internal.cpp | 14 +- components/lib/qtmaterialcheckable_internal.h | 31 ++-- components/lib/qtmaterialcheckable_p.h | 27 ++-- components/lib/qtmaterialoverlaywidget.cpp | 14 +- components/lib/qtmaterialoverlaywidget.h | 11 +- components/lib/qtmaterialripple.cpp | 26 ++-- components/lib/qtmaterialripple.h | 45 +++--- components/lib/qtmaterialrippleoverlay.cpp | 24 ++-- components/lib/qtmaterialrippleoverlay.h | 31 ++-- components/lib/qtmaterialstatetransition.cpp | 11 +- components/lib/qtmaterialstatetransition.h | 9 +- .../lib/qtmaterialstatetransitionevent.h | 11 +- components/lib/qtmaterialstyle.cpp | 26 ++-- components/lib/qtmaterialstyle.h | 25 ++-- components/lib/qtmaterialstyle_p.h | 21 +-- components/lib/qtmaterialtheme.cpp | 31 ++-- components/lib/qtmaterialtheme.h | 17 ++- components/lib/qtmaterialtheme_p.h | 17 ++- 20 files changed, 305 insertions(+), 240 deletions(-) diff --git a/components/lib/qtmaterialcheckable.cpp b/components/lib/qtmaterialcheckable.cpp index ee4e0bd88..8a6f2507c 100644 --- a/components/lib/qtmaterialcheckable.cpp +++ b/components/lib/qtmaterialcheckable.cpp @@ -12,27 +12,29 @@ #include "lib/qtmaterialstyle.h" #include "lib/qtmaterialcheckable_internal.h" +namespace md +{ /*! * \class QtMaterialCheckablePrivate * \internal */ -QtMaterialCheckablePrivate::QtMaterialCheckablePrivate(QtMaterialCheckable *q) +CheckablePrivate::CheckablePrivate(Checkable *q) : q_ptr(q) { } -QtMaterialCheckablePrivate::~QtMaterialCheckablePrivate() +CheckablePrivate::~CheckablePrivate() { } -void QtMaterialCheckablePrivate::init() +void CheckablePrivate::init() { - Q_Q(QtMaterialCheckable); + Q_Q(Checkable); - rippleOverlay = new QtMaterialRippleOverlay; - checkedIcon = new QtMaterialCheckableIcon(QIcon(":/icons/icons/toggle/svg/production/ic_check_box_24px.svg"), q); - uncheckedIcon = new QtMaterialCheckableIcon(QIcon(":/icons/icons/toggle/svg/production/ic_check_box_outline_blank_24px.svg"), q); + rippleOverlay = new RippleOverlay; + checkedIcon = new CheckableIcon(QIcon(":/icons/icons/toggle/svg/production/ic_check_box_24px.svg"), q); + uncheckedIcon = new CheckableIcon(QIcon(":/icons/icons/toggle/svg/production/ic_check_box_outline_blank_24px.svg"), q); stateMachine = new QStateMachine(q); uncheckedState = new QState; checkedState = new QState; @@ -40,14 +42,14 @@ void QtMaterialCheckablePrivate::init() disabledCheckedState = new QState; uncheckedTransition = new QSignalTransition(q, SIGNAL(toggled(bool))); checkedTransition = new QSignalTransition(q, SIGNAL(toggled(bool))); - labelPosition = QtMaterialCheckable::LabelPositionRight; + labelPosition = Checkable::LabelPositionRight; useThemeColors = true; rippleOverlay->setParent(q->parentWidget()); rippleOverlay->installEventFilter(q); q->setCheckable(true); - q->setStyle(&QtMaterialStyle::instance()); + q->setStyle(&Style::instance()); q->setFont(QFont("Roboto", 11, QFont::Normal)); stateMachine->addState(uncheckedState); @@ -125,35 +127,35 @@ void QtMaterialCheckablePrivate::init() * \class QtMaterialCheckable */ -QtMaterialCheckable::QtMaterialCheckable(QWidget *parent) +Checkable::Checkable(QWidget *parent) : QAbstractButton(parent), - d_ptr(new QtMaterialCheckablePrivate(this)) + d_ptr(new CheckablePrivate(this)) { d_func()->init(); } -QtMaterialCheckable::~QtMaterialCheckable() +Checkable::~Checkable() { } -void QtMaterialCheckable::setLabelPosition(LabelPosition placement) +void Checkable::setLabelPosition(LabelPosition placement) { - Q_D(QtMaterialCheckable); + Q_D(Checkable); d->labelPosition = placement; update(); } -QtMaterialCheckable::LabelPosition QtMaterialCheckable::labelPosition() const +Checkable::LabelPosition Checkable::labelPosition() const { - Q_D(const QtMaterialCheckable); + Q_D(const Checkable); return d->labelPosition; } -void QtMaterialCheckable::setUseThemeColors(bool value) +void Checkable::setUseThemeColors(bool value) { - Q_D(QtMaterialCheckable); + Q_D(Checkable); if (d->useThemeColors == value) { return; @@ -163,16 +165,16 @@ void QtMaterialCheckable::setUseThemeColors(bool value) setupProperties(); } -bool QtMaterialCheckable::useThemeColors() const +bool Checkable::useThemeColors() const { - Q_D(const QtMaterialCheckable); + Q_D(const Checkable); return d->useThemeColors; } -void QtMaterialCheckable::setCheckedColor(const QColor &color) +void Checkable::setCheckedColor(const QColor &color) { - Q_D(QtMaterialCheckable); + Q_D(Checkable); d->checkedColor = color; @@ -180,20 +182,20 @@ void QtMaterialCheckable::setCheckedColor(const QColor &color) setupProperties(); } -QColor QtMaterialCheckable::checkedColor() const +QColor Checkable::checkedColor() const { - Q_D(const QtMaterialCheckable); + Q_D(const Checkable); if (d->useThemeColors || !d->checkedColor.isValid()) { - return QtMaterialStyle::instance().themeColor("primary1"); + return Style::instance().themeColor("primary1"); } else { return d->checkedColor; } } -void QtMaterialCheckable::setUncheckedColor(const QColor &color) +void Checkable::setUncheckedColor(const QColor &color) { - Q_D(QtMaterialCheckable); + Q_D(Checkable); d->uncheckedColor = color; @@ -201,20 +203,20 @@ void QtMaterialCheckable::setUncheckedColor(const QColor &color) setupProperties(); } -QColor QtMaterialCheckable::uncheckedColor() const +QColor Checkable::uncheckedColor() const { - Q_D(const QtMaterialCheckable); + Q_D(const Checkable); if (d->useThemeColors || !d->uncheckedColor.isValid()) { - return QtMaterialStyle::instance().themeColor("text"); + return Style::instance().themeColor("text"); } else { return d->uncheckedColor; } } -void QtMaterialCheckable::setTextColor(const QColor &color) +void Checkable::setTextColor(const QColor &color) { - Q_D(QtMaterialCheckable); + Q_D(Checkable); d->textColor = color; @@ -222,20 +224,20 @@ void QtMaterialCheckable::setTextColor(const QColor &color) setupProperties(); } -QColor QtMaterialCheckable::textColor() const +QColor Checkable::textColor() const { - Q_D(const QtMaterialCheckable); + Q_D(const Checkable); if (d->useThemeColors || !d->textColor.isValid()) { - return QtMaterialStyle::instance().themeColor("text"); + return Style::instance().themeColor("text"); } else { return d->textColor; } } -void QtMaterialCheckable::setDisabledColor(const QColor &color) +void Checkable::setDisabledColor(const QColor &color) { - Q_D(QtMaterialCheckable); + Q_D(Checkable); d->disabledColor = color; @@ -243,43 +245,43 @@ void QtMaterialCheckable::setDisabledColor(const QColor &color) setupProperties(); } -QColor QtMaterialCheckable::disabledColor() const +QColor Checkable::disabledColor() const { - Q_D(const QtMaterialCheckable); + Q_D(const Checkable); if (d->useThemeColors || !d->disabledColor.isValid()) { - return QtMaterialStyle::instance().themeColor("accent3"); + return Style::instance().themeColor("accent3"); } else { return d->disabledColor; } } -void QtMaterialCheckable::setCheckedIcon(const QIcon &icon) +void Checkable::setCheckedIcon(const QIcon &icon) { - Q_D(QtMaterialCheckable); + Q_D(Checkable); d->checkedIcon->setIcon(icon); update(); } -QIcon QtMaterialCheckable::checkedIcon() const +QIcon Checkable::checkedIcon() const { - Q_D(const QtMaterialCheckable); + Q_D(const Checkable); return d->checkedIcon->icon(); } -void QtMaterialCheckable::setUncheckedIcon(const QIcon &icon) +void Checkable::setUncheckedIcon(const QIcon &icon) { - Q_D(QtMaterialCheckable); + Q_D(Checkable); d->uncheckedIcon->setIcon(icon); update(); } -QIcon QtMaterialCheckable::uncheckedIcon() const +QIcon Checkable::uncheckedIcon() const { - Q_D(const QtMaterialCheckable); + Q_D(const Checkable); return d->uncheckedIcon->icon(); } @@ -287,7 +289,7 @@ QIcon QtMaterialCheckable::uncheckedIcon() const /*! * \reimp */ -QSize QtMaterialCheckable::sizeHint() const +QSize Checkable::sizeHint() const { if (text().isEmpty()) { return QSize(40, 40); @@ -295,7 +297,7 @@ QSize QtMaterialCheckable::sizeHint() const return QSize(fontMetrics().size(Qt::TextShowMnemonic, text()).width()+52, 40); } -QtMaterialCheckable::QtMaterialCheckable(QtMaterialCheckablePrivate &d, QWidget *parent) +Checkable::Checkable(CheckablePrivate &d, QWidget *parent) : QAbstractButton(parent), d_ptr(&d) { @@ -305,9 +307,9 @@ QtMaterialCheckable::QtMaterialCheckable(QtMaterialCheckablePrivate &d, QWidget /*! * \reimp */ -bool QtMaterialCheckable::event(QEvent *event) +bool Checkable::event(QEvent *event) { - Q_D(QtMaterialCheckable); + Q_D(Checkable); switch (event->type()) { @@ -332,11 +334,11 @@ bool QtMaterialCheckable::event(QEvent *event) /*! * \reimp */ -bool QtMaterialCheckable::eventFilter(QObject *obj, QEvent *event) +bool Checkable::eventFilter(QObject *obj, QEvent *event) { if (QEvent::Resize == event->type()) { - Q_D(QtMaterialCheckable); + Q_D(Checkable); d->rippleOverlay->setGeometry(geometry().adjusted(-8, -8, 8, 8)); } @@ -346,21 +348,21 @@ bool QtMaterialCheckable::eventFilter(QObject *obj, QEvent *event) /*! * \reimp */ -void QtMaterialCheckable::mousePressEvent(QMouseEvent *event) +void Checkable::mousePressEvent(QMouseEvent *event) { Q_UNUSED(event) - Q_D(QtMaterialCheckable); + Q_D(Checkable); if (!isEnabled()) { return; } - QtMaterialRipple *ripple; - if (QtMaterialCheckable::LabelPositionLeft == d->labelPosition) { - ripple = new QtMaterialRipple(QPoint(width()-14, 28)); + Ripple *ripple; + if (Checkable::LabelPositionLeft == d->labelPosition) { + ripple = new Ripple(QPoint(width()-14, 28)); } else { - ripple = new QtMaterialRipple(QPoint(28, 28)); + ripple = new Ripple(QPoint(28, 28)); } ripple->setRadiusEndValue(22); ripple->setColor(isChecked() ? checkedColor() : uncheckedColor()); @@ -375,11 +377,11 @@ void QtMaterialCheckable::mousePressEvent(QMouseEvent *event) /*! * \reimp */ -void QtMaterialCheckable::paintEvent(QPaintEvent *event) +void Checkable::paintEvent(QPaintEvent *event) { Q_UNUSED(event) - Q_D(QtMaterialCheckable); + Q_D(Checkable); QPainter painter(this); @@ -387,16 +389,16 @@ void QtMaterialCheckable::paintEvent(QPaintEvent *event) pen.setColor(isEnabled() ? textColor() : disabledColor()); painter.setPen(pen); - if (QtMaterialCheckable::LabelPositionLeft == d->labelPosition) { + if (Checkable::LabelPositionLeft == d->labelPosition) { painter.drawText(4, 25, text()); } else { painter.drawText(48, 25, text()); } } -void QtMaterialCheckable::setupProperties() +void Checkable::setupProperties() { - Q_D(QtMaterialCheckable); + Q_D(Checkable); d->checkedState->assignProperty(d->checkedIcon, "color", checkedColor()); d->checkedState->assignProperty(d->uncheckedIcon, "color", checkedColor()); @@ -417,3 +419,5 @@ void QtMaterialCheckable::setupProperties() update(); } + +} diff --git a/components/lib/qtmaterialcheckable.h b/components/lib/qtmaterialcheckable.h index c4cc57469..7ac3a86b6 100644 --- a/components/lib/qtmaterialcheckable.h +++ b/components/lib/qtmaterialcheckable.h @@ -2,10 +2,11 @@ #define QTMATERIALCHECKABLE_H #include +namespace md +{ +class CheckablePrivate; -class QtMaterialCheckablePrivate; - -class QtMaterialCheckable : public QAbstractButton +class Checkable : public QAbstractButton { Q_OBJECT @@ -15,8 +16,8 @@ class QtMaterialCheckable : public QAbstractButton LabelPositionRight, }; - explicit QtMaterialCheckable(QWidget *parent = 0); - ~QtMaterialCheckable(); + explicit Checkable(QWidget *parent = 0); + ~Checkable(); void setLabelPosition(LabelPosition placement); LabelPosition labelPosition() const; @@ -45,7 +46,7 @@ class QtMaterialCheckable : public QAbstractButton QSize sizeHint() const Q_DECL_OVERRIDE; protected: - QtMaterialCheckable(QtMaterialCheckablePrivate &d, QWidget *parent = 0); + Checkable(CheckablePrivate &d, QWidget *parent = 0); bool event(QEvent *event) Q_DECL_OVERRIDE; bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE; @@ -54,11 +55,12 @@ class QtMaterialCheckable : public QAbstractButton virtual void setupProperties(); - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QtMaterialCheckable) - Q_DECLARE_PRIVATE(QtMaterialCheckable) + Q_DISABLE_COPY(Checkable) + Q_DECLARE_PRIVATE(Checkable) }; +} #endif // QTMATERIALCHECKABLE_H diff --git a/components/lib/qtmaterialcheckable_internal.cpp b/components/lib/qtmaterialcheckable_internal.cpp index 4a7eb9a72..075fba679 100644 --- a/components/lib/qtmaterialcheckable_internal.cpp +++ b/components/lib/qtmaterialcheckable_internal.cpp @@ -4,12 +4,14 @@ #include #include "lib/qtmaterialcheckable.h" +namespace md +{ /*! * \class QtMaterialCheckableIcon * \internal */ -QtMaterialCheckableIcon::QtMaterialCheckableIcon(const QIcon &icon, QtMaterialCheckable *parent) +CheckableIcon::CheckableIcon(const QIcon &icon, Checkable *parent) : QWidget(parent), m_checkable(parent), m_color(Qt::black), @@ -22,16 +24,16 @@ QtMaterialCheckableIcon::QtMaterialCheckableIcon(const QIcon &icon, QtMaterialCh setAttribute(Qt::WA_TransparentForMouseEvents); } -QtMaterialCheckableIcon::~QtMaterialCheckableIcon() +CheckableIcon::~CheckableIcon() { } -QSize QtMaterialCheckableIcon::sizeHint() const +QSize CheckableIcon::sizeHint() const { return QSize(m_iconSize, m_iconSize); } -void QtMaterialCheckableIcon::paintEvent(QPaintEvent *event) +void CheckableIcon::paintEvent(QPaintEvent *event) { Q_UNUSED(event) @@ -47,7 +49,7 @@ void QtMaterialCheckableIcon::paintEvent(QPaintEvent *event) const qreal z = m_iconSize/24; QTransform t; - if (QtMaterialCheckable::LabelPositionLeft == m_checkable->labelPosition()) { + if (Checkable::LabelPositionLeft == m_checkable->labelPosition()) { t.translate(p+width()-42, p); } else { t.translate(p, p); @@ -61,3 +63,5 @@ void QtMaterialCheckableIcon::paintEvent(QPaintEvent *event) painter.drawPixmap(0, 0, pixmap); } } + +} diff --git a/components/lib/qtmaterialcheckable_internal.h b/components/lib/qtmaterialcheckable_internal.h index 3fb3d947d..c7d3bc4cf 100644 --- a/components/lib/qtmaterialcheckable_internal.h +++ b/components/lib/qtmaterialcheckable_internal.h @@ -5,9 +5,11 @@ #include #include -class QtMaterialCheckable; +namespace md +{ +class Checkable; -class QtMaterialCheckableIcon : public QWidget +class CheckableIcon : public QWidget { Q_OBJECT @@ -16,8 +18,8 @@ class QtMaterialCheckableIcon : public QWidget Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity) public: - QtMaterialCheckableIcon(const QIcon &icon, QtMaterialCheckable *parent); - ~QtMaterialCheckableIcon(); + CheckableIcon(const QIcon &icon, Checkable *parent); + ~CheckableIcon(); QSize sizeHint() const Q_DECL_OVERRIDE; @@ -37,57 +39,58 @@ class QtMaterialCheckableIcon : public QWidget void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(QtMaterialCheckableIcon) + Q_DISABLE_COPY(CheckableIcon) - QtMaterialCheckable *const m_checkable; + Checkable *const m_checkable; QColor m_color; QIcon m_icon; qreal m_iconSize; qreal m_opacity; }; -inline void QtMaterialCheckableIcon::setIcon(const QIcon &icon) +inline void CheckableIcon::setIcon(const QIcon &icon) { m_icon = icon; update(); } -inline QIcon QtMaterialCheckableIcon::icon() const +inline QIcon CheckableIcon::icon() const { return m_icon; } -inline void QtMaterialCheckableIcon::setColor(const QColor &color) +inline void CheckableIcon::setColor(const QColor &color) { m_color = color; update(); } -inline QColor QtMaterialCheckableIcon::color() const +inline QColor CheckableIcon::color() const { return m_color; } -inline void QtMaterialCheckableIcon::setIconSize(qreal size) +inline void CheckableIcon::setIconSize(qreal size) { m_iconSize = size; update(); } -inline qreal QtMaterialCheckableIcon::iconSize() const +inline qreal CheckableIcon::iconSize() const { return m_iconSize; } -inline void QtMaterialCheckableIcon::setOpacity(qreal opacity) +inline void CheckableIcon::setOpacity(qreal opacity) { m_opacity = opacity; update(); } -inline qreal QtMaterialCheckableIcon::opacity() const +inline qreal CheckableIcon::opacity() const { return m_opacity; } +} #endif // QTMATERIALCHECKABLE_INTERNAL_H diff --git a/components/lib/qtmaterialcheckable_p.h b/components/lib/qtmaterialcheckable_p.h index e678df70f..57c4cf8e0 100644 --- a/components/lib/qtmaterialcheckable_p.h +++ b/components/lib/qtmaterialcheckable_p.h @@ -4,27 +4,29 @@ #include #include "lib/qtmaterialcheckable.h" +namespace md +{ class QStateMachine; class QState; class QSignalTransition; -class QtMaterialRippleOverlay; -class QtMaterialCheckableIcon; +class RippleOverlay; +class CheckableIcon; -class QtMaterialCheckablePrivate +class CheckablePrivate { - Q_DISABLE_COPY(QtMaterialCheckablePrivate) - Q_DECLARE_PUBLIC(QtMaterialCheckable) + Q_DISABLE_COPY(CheckablePrivate) + Q_DECLARE_PUBLIC(Checkable) public: - QtMaterialCheckablePrivate(QtMaterialCheckable *q); - virtual ~QtMaterialCheckablePrivate(); + CheckablePrivate(Checkable *q); + virtual ~CheckablePrivate(); void init(); - QtMaterialCheckable *const q_ptr; - QtMaterialRippleOverlay *rippleOverlay; - QtMaterialCheckableIcon *checkedIcon; - QtMaterialCheckableIcon *uncheckedIcon; + Checkable *const q_ptr; + RippleOverlay *rippleOverlay; + CheckableIcon *checkedIcon; + CheckableIcon *uncheckedIcon; QStateMachine *stateMachine; QState *uncheckedState; QState *checkedState; @@ -32,12 +34,13 @@ class QtMaterialCheckablePrivate QState *disabledCheckedState; QSignalTransition *uncheckedTransition; QSignalTransition *checkedTransition; - QtMaterialCheckable::LabelPosition labelPosition; + Checkable::LabelPosition labelPosition; QColor checkedColor; QColor uncheckedColor; QColor textColor; QColor disabledColor; bool useThemeColors; }; +} #endif // QTMATERIALCHECKABLE_P_H diff --git a/components/lib/qtmaterialoverlaywidget.cpp b/components/lib/qtmaterialoverlaywidget.cpp index ec0e7fedb..cc2c59bfa 100644 --- a/components/lib/qtmaterialoverlaywidget.cpp +++ b/components/lib/qtmaterialoverlaywidget.cpp @@ -1,12 +1,14 @@ #include "lib/qtmaterialoverlaywidget.h" #include +namespace md +{ /*! * \class QtMaterialOverlayWidget * \internal */ -QtMaterialOverlayWidget::QtMaterialOverlayWidget(QWidget *parent) +OverlayWidget::OverlayWidget(QWidget *parent) : QWidget(parent) { if (parent) { @@ -14,14 +16,14 @@ QtMaterialOverlayWidget::QtMaterialOverlayWidget(QWidget *parent) } } -QtMaterialOverlayWidget::~QtMaterialOverlayWidget() +OverlayWidget::~OverlayWidget() { } /*! * \reimp */ -bool QtMaterialOverlayWidget::event(QEvent *event) +bool OverlayWidget::event(QEvent *event) { if (!parent()) { return QWidget::event(event); @@ -48,7 +50,7 @@ bool QtMaterialOverlayWidget::event(QEvent *event) /*! * \reimp */ -bool QtMaterialOverlayWidget::eventFilter(QObject *obj, QEvent *event) +bool OverlayWidget::eventFilter(QObject *obj, QEvent *event) { switch (event->type()) { @@ -62,7 +64,7 @@ bool QtMaterialOverlayWidget::eventFilter(QObject *obj, QEvent *event) return QWidget::eventFilter(obj, event); } -QRect QtMaterialOverlayWidget::overlayGeometry() const +QRect OverlayWidget::overlayGeometry() const { QWidget *widget = parentWidget(); if (!widget) { @@ -70,3 +72,5 @@ QRect QtMaterialOverlayWidget::overlayGeometry() const } return widget->rect(); } + +} diff --git a/components/lib/qtmaterialoverlaywidget.h b/components/lib/qtmaterialoverlaywidget.h index 11acba020..26914d6eb 100644 --- a/components/lib/qtmaterialoverlaywidget.h +++ b/components/lib/qtmaterialoverlaywidget.h @@ -3,13 +3,15 @@ #include -class QtMaterialOverlayWidget : public QWidget +namespace md +{ +class OverlayWidget : public QWidget { Q_OBJECT public: - explicit QtMaterialOverlayWidget(QWidget *parent = 0); - ~QtMaterialOverlayWidget(); + explicit OverlayWidget(QWidget *parent = 0); + ~OverlayWidget(); protected: bool event(QEvent *event) Q_DECL_OVERRIDE; @@ -18,7 +20,8 @@ class QtMaterialOverlayWidget : public QWidget virtual QRect overlayGeometry() const; private: - Q_DISABLE_COPY(QtMaterialOverlayWidget) + Q_DISABLE_COPY(OverlayWidget) }; +} #endif // QTMATERIALOVERLAYWIDGET_H diff --git a/components/lib/qtmaterialripple.cpp b/components/lib/qtmaterialripple.cpp index 82125cbf8..bed491b22 100644 --- a/components/lib/qtmaterialripple.cpp +++ b/components/lib/qtmaterialripple.cpp @@ -1,12 +1,14 @@ #include "qtmaterialripple.h" #include "lib/qtmaterialrippleoverlay.h" +namespace md +{ /*! * \class QtMaterialRipple * \internal */ -QtMaterialRipple::QtMaterialRipple(const QPoint ¢er, QObject *parent) +Ripple::Ripple(const QPoint ¢er, QObject *parent) : QParallelAnimationGroup(parent), m_overlay(0), m_radiusAnimation(animate("radius")), @@ -18,8 +20,8 @@ QtMaterialRipple::QtMaterialRipple(const QPoint ¢er, QObject *parent) init(); } -QtMaterialRipple::QtMaterialRipple(const QPoint ¢er, - QtMaterialRippleOverlay *overlay, +Ripple::Ripple(const QPoint ¢er, + RippleOverlay *overlay, QObject *parent) : QParallelAnimationGroup(parent), m_overlay(overlay), @@ -32,11 +34,11 @@ QtMaterialRipple::QtMaterialRipple(const QPoint ¢er, init(); } -QtMaterialRipple::~QtMaterialRipple() +Ripple::~Ripple() { } -void QtMaterialRipple::setRadius(qreal radius) +void Ripple::setRadius(qreal radius) { Q_ASSERT(m_overlay); @@ -47,7 +49,7 @@ void QtMaterialRipple::setRadius(qreal radius) m_overlay->update(); } -void QtMaterialRipple::setOpacity(qreal opacity) +void Ripple::setOpacity(qreal opacity) { Q_ASSERT(m_overlay); @@ -58,7 +60,7 @@ void QtMaterialRipple::setOpacity(qreal opacity) m_overlay->update(); } -void QtMaterialRipple::setColor(const QColor &color) +void Ripple::setColor(const QColor &color) { if (m_brush.color() == color) { return; @@ -70,7 +72,7 @@ void QtMaterialRipple::setColor(const QColor &color) } } -void QtMaterialRipple::setBrush(const QBrush &brush) +void Ripple::setBrush(const QBrush &brush) { m_brush = brush; @@ -79,7 +81,7 @@ void QtMaterialRipple::setBrush(const QBrush &brush) } } -void QtMaterialRipple::destroy() +void Ripple::destroy() { Q_ASSERT(m_overlay); @@ -89,7 +91,7 @@ void QtMaterialRipple::destroy() /*! * \internal */ -QPropertyAnimation *QtMaterialRipple::animate(const QByteArray &property, +QPropertyAnimation *Ripple::animate(const QByteArray &property, const QEasingCurve &easing, int duration) { @@ -105,7 +107,7 @@ QPropertyAnimation *QtMaterialRipple::animate(const QByteArray &property, /*! * \internal */ -void QtMaterialRipple::init() +void Ripple::init() { setOpacityStartValue(0.5); setOpacityEndValue(0); @@ -117,3 +119,5 @@ void QtMaterialRipple::init() connect(this, SIGNAL(finished()), this, SLOT(destroy())); } + +} diff --git a/components/lib/qtmaterialripple.h b/components/lib/qtmaterialripple.h index d263c76fc..60074c59c 100644 --- a/components/lib/qtmaterialripple.h +++ b/components/lib/qtmaterialripple.h @@ -7,9 +7,11 @@ #include #include -class QtMaterialRippleOverlay; +namespace md +{ +class RippleOverlay; -class QtMaterialRipple : public QParallelAnimationGroup +class Ripple : public QParallelAnimationGroup { Q_OBJECT @@ -17,11 +19,11 @@ class QtMaterialRipple : public QParallelAnimationGroup Q_PROPERTY(qreal opacity WRITE setOpacity READ opacity) public: - explicit QtMaterialRipple(const QPoint ¢er, QObject *parent = 0); - QtMaterialRipple(const QPoint ¢er, QtMaterialRippleOverlay *overlay, QObject *parent = 0); - ~QtMaterialRipple(); + explicit Ripple(const QPoint ¢er, QObject *parent = 0); + Ripple(const QPoint ¢er, RippleOverlay *overlay, QObject *parent = 0); + ~Ripple(); - inline void setOverlay(QtMaterialRippleOverlay *overlay); + inline void setOverlay(RippleOverlay *overlay); void setRadius(qreal radius); inline qreal radius() const; @@ -50,7 +52,7 @@ protected slots: void destroy(); private: - Q_DISABLE_COPY(QtMaterialRipple) + Q_DISABLE_COPY(Ripple) QPropertyAnimation *animate(const QByteArray &property, const QEasingCurve &easing = QEasingCurve::OutQuad, @@ -58,7 +60,7 @@ protected slots: void init(); - QtMaterialRippleOverlay *m_overlay; + RippleOverlay *m_overlay; QPropertyAnimation *const m_radiusAnimation; QPropertyAnimation *const m_opacityAnimation; qreal m_radius; @@ -67,70 +69,71 @@ protected slots: QBrush m_brush; }; -inline void QtMaterialRipple::setOverlay(QtMaterialRippleOverlay *overlay) +inline void Ripple::setOverlay(RippleOverlay *overlay) { m_overlay = overlay; } -inline qreal QtMaterialRipple::radius() const +inline qreal Ripple::radius() const { return m_radius; } -inline qreal QtMaterialRipple::opacity() const +inline qreal Ripple::opacity() const { return m_opacity; } -inline QColor QtMaterialRipple::color() const +inline QColor Ripple::color() const { return m_brush.color(); } -inline QBrush QtMaterialRipple::brush() const +inline QBrush Ripple::brush() const { return m_brush; } -inline QPoint QtMaterialRipple::center() const +inline QPoint Ripple::center() const { return m_center; } -inline QPropertyAnimation *QtMaterialRipple::radiusAnimation() const +inline QPropertyAnimation *Ripple::radiusAnimation() const { return m_radiusAnimation; } -inline QPropertyAnimation *QtMaterialRipple::opacityAnimation() const +inline QPropertyAnimation *Ripple::opacityAnimation() const { return m_opacityAnimation; } -inline void QtMaterialRipple::setOpacityStartValue(qreal value) +inline void Ripple::setOpacityStartValue(qreal value) { m_opacityAnimation->setStartValue(value); } -inline void QtMaterialRipple::setOpacityEndValue(qreal value) +inline void Ripple::setOpacityEndValue(qreal value) { m_opacityAnimation->setEndValue(value); } -inline void QtMaterialRipple::setRadiusStartValue(qreal value) +inline void Ripple::setRadiusStartValue(qreal value) { m_radiusAnimation->setStartValue(value); } -inline void QtMaterialRipple::setRadiusEndValue(qreal value) +inline void Ripple::setRadiusEndValue(qreal value) { m_radiusAnimation->setEndValue(value); } -inline void QtMaterialRipple::setDuration(int msecs) +inline void Ripple::setDuration(int msecs) { m_radiusAnimation->setDuration(msecs); m_opacityAnimation->setDuration(msecs); } +} #endif // QTMATERIALRIPPLE_H diff --git a/components/lib/qtmaterialrippleoverlay.cpp b/components/lib/qtmaterialrippleoverlay.cpp index 062d215bc..2da652abd 100644 --- a/components/lib/qtmaterialrippleoverlay.cpp +++ b/components/lib/qtmaterialrippleoverlay.cpp @@ -2,24 +2,26 @@ #include #include "lib/qtmaterialripple.h" +namespace md +{ /*! * \class QtMaterialRippleOverlay * \internal */ -QtMaterialRippleOverlay::QtMaterialRippleOverlay(QWidget *parent) - : QtMaterialOverlayWidget(parent), +RippleOverlay::RippleOverlay(QWidget *parent) + : OverlayWidget(parent), m_useClip(false) { setAttribute(Qt::WA_TransparentForMouseEvents); setAttribute(Qt::WA_NoSystemBackground); } -QtMaterialRippleOverlay::~QtMaterialRippleOverlay() +RippleOverlay::~RippleOverlay() { } -void QtMaterialRippleOverlay::addRipple(QtMaterialRipple *ripple) +void RippleOverlay::addRipple(Ripple *ripple) { ripple->setOverlay(this); m_ripples.push_back(ripple); @@ -29,14 +31,14 @@ void QtMaterialRippleOverlay::addRipple(QtMaterialRipple *ripple) connect(this, SIGNAL(destroyed(QObject*)), ripple, SLOT(deleteLater())); } -void QtMaterialRippleOverlay::addRipple(const QPoint &position, qreal radius) +void RippleOverlay::addRipple(const QPoint &position, qreal radius) { - QtMaterialRipple *ripple = new QtMaterialRipple(position); + Ripple *ripple = new Ripple(position); ripple->setRadiusEndValue(radius); addRipple(ripple); } -void QtMaterialRippleOverlay::removeRipple(QtMaterialRipple *ripple) +void RippleOverlay::removeRipple(Ripple *ripple) { if (m_ripples.removeOne(ripple)) { delete ripple; @@ -47,7 +49,7 @@ void QtMaterialRippleOverlay::removeRipple(QtMaterialRipple *ripple) /*! * \reimp */ -void QtMaterialRippleOverlay::paintEvent(QPaintEvent *event) +void RippleOverlay::paintEvent(QPaintEvent *event) { Q_UNUSED(event) @@ -59,13 +61,13 @@ void QtMaterialRippleOverlay::paintEvent(QPaintEvent *event) painter.setClipPath(m_clipPath); } - QList::const_iterator i; + QList::const_iterator i; for (i = m_ripples.begin(); i != m_ripples.end(); ++i) { paintRipple(&painter, *i); } } -void QtMaterialRippleOverlay::paintRipple(QPainter *painter, QtMaterialRipple *ripple) +void RippleOverlay::paintRipple(QPainter *painter, Ripple *ripple) { const qreal radius = ripple->radius(); const QPointF center = ripple->center(); @@ -73,3 +75,5 @@ void QtMaterialRippleOverlay::paintRipple(QPainter *painter, QtMaterialRipple *r painter->setBrush(ripple->brush()); painter->drawEllipse(center, radius, radius); } + +} diff --git a/components/lib/qtmaterialrippleoverlay.h b/components/lib/qtmaterialrippleoverlay.h index 436c2b932..639a9df11 100644 --- a/components/lib/qtmaterialrippleoverlay.h +++ b/components/lib/qtmaterialrippleoverlay.h @@ -4,20 +4,22 @@ #include #include "lib/qtmaterialoverlaywidget.h" -class QtMaterialRipple; +namespace md +{ +class Ripple; -class QtMaterialRippleOverlay : public QtMaterialOverlayWidget +class RippleOverlay : public OverlayWidget { Q_OBJECT public: - explicit QtMaterialRippleOverlay(QWidget *parent = 0); - ~QtMaterialRippleOverlay(); + explicit RippleOverlay(QWidget *parent = 0); + ~RippleOverlay(); - void addRipple(QtMaterialRipple *ripple); + void addRipple(Ripple *ripple); void addRipple(const QPoint &position, qreal radius = 300); - void removeRipple(QtMaterialRipple *ripple); + void removeRipple(Ripple *ripple); inline void setClipping(bool enable); inline bool hasClipping() const; @@ -27,38 +29,39 @@ class QtMaterialRippleOverlay : public QtMaterialOverlayWidget protected: void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; - inline QList ripples() const; + inline QList ripples() const; private: - Q_DISABLE_COPY(QtMaterialRippleOverlay) + Q_DISABLE_COPY(RippleOverlay) - void paintRipple(QPainter *painter, QtMaterialRipple *ripple); + void paintRipple(QPainter *painter, Ripple *ripple); - QList m_ripples; + QList m_ripples; QPainterPath m_clipPath; bool m_useClip; }; -inline void QtMaterialRippleOverlay::setClipping(bool enable) +inline void RippleOverlay::setClipping(bool enable) { m_useClip = enable; update(); } -inline bool QtMaterialRippleOverlay::hasClipping() const +inline bool RippleOverlay::hasClipping() const { return m_useClip; } -inline void QtMaterialRippleOverlay::setClipPath(const QPainterPath &path) +inline void RippleOverlay::setClipPath(const QPainterPath &path) { m_clipPath = path; update(); } -inline QList QtMaterialRippleOverlay::ripples() const +inline QList RippleOverlay::ripples() const { return m_ripples; } +} #endif // QTMATERIALRIPPLEOVERLAY_H diff --git a/components/lib/qtmaterialstatetransition.cpp b/components/lib/qtmaterialstatetransition.cpp index 75f1faf06..bbfbd16dc 100644 --- a/components/lib/qtmaterialstatetransition.cpp +++ b/components/lib/qtmaterialstatetransition.cpp @@ -1,19 +1,22 @@ #include "lib/qtmaterialstatetransition.h" -QtMaterialStateTransition::QtMaterialStateTransition(QtMaterialStateTransitionType type) +namespace md +{ +StateTransition::StateTransition(StateTransitionType type) : m_type(type) { } -bool QtMaterialStateTransition::eventTest(QEvent *event) +bool StateTransition::eventTest(QEvent *event) { if (event->type() != QEvent::Type(QEvent::User + 1)) { return false; } - QtMaterialStateTransitionEvent *transition = static_cast(event); + StateTransitionEvent *transition = static_cast(event); return (m_type == transition->type); } -void QtMaterialStateTransition::onTransition(QEvent *) +void StateTransition::onTransition(QEvent *) { } +} diff --git a/components/lib/qtmaterialstatetransition.h b/components/lib/qtmaterialstatetransition.h index d5013022b..e7e317282 100644 --- a/components/lib/qtmaterialstatetransition.h +++ b/components/lib/qtmaterialstatetransition.h @@ -4,19 +4,22 @@ #include #include "lib/qtmaterialstatetransitionevent.h" -class QtMaterialStateTransition : public QAbstractTransition +namespace md +{ +class StateTransition : public QAbstractTransition { Q_OBJECT public: - QtMaterialStateTransition(QtMaterialStateTransitionType type); + StateTransition(StateTransitionType type); protected: virtual bool eventTest(QEvent *event); virtual void onTransition(QEvent *); private: - QtMaterialStateTransitionType m_type; + StateTransitionType m_type; }; +} #endif // QTMATERIALSTATETRANSITION_H diff --git a/components/lib/qtmaterialstatetransitionevent.h b/components/lib/qtmaterialstatetransitionevent.h index 1c64ec623..c797e9243 100644 --- a/components/lib/qtmaterialstatetransitionevent.h +++ b/components/lib/qtmaterialstatetransitionevent.h @@ -3,7 +3,9 @@ #include -enum QtMaterialStateTransitionType { +namespace md +{ +enum StateTransitionType { // Snackbar SnackbarShowTransition = 1, SnackbarHideTransition, @@ -28,15 +30,16 @@ enum QtMaterialStateTransitionType { MaxTransitionType = 65535 }; -struct QtMaterialStateTransitionEvent : public QEvent +struct StateTransitionEvent : public QEvent { - QtMaterialStateTransitionEvent(QtMaterialStateTransitionType type) + StateTransitionEvent(StateTransitionType type) : QEvent(QEvent::Type(QEvent::User + 1)), type(type) { } - QtMaterialStateTransitionType type; + StateTransitionType type; }; +} #endif // QTMATERIALSTATETRANSITIONEVENT_H diff --git a/components/lib/qtmaterialstyle.cpp b/components/lib/qtmaterialstyle.cpp index 83bbab8ae..a9f61215c 100644 --- a/components/lib/qtmaterialstyle.cpp +++ b/components/lib/qtmaterialstyle.cpp @@ -2,29 +2,31 @@ #include #include "lib/qtmaterialtheme.h" +namespace md +{ /*! * \class QtMaterialStylePrivate * \internal */ -QtMaterialStylePrivate::QtMaterialStylePrivate(QtMaterialStyle *q) +StylePrivate::StylePrivate(Style *q) : q_ptr(q) { } -QtMaterialStylePrivate::~QtMaterialStylePrivate() +StylePrivate::~StylePrivate() { } -void QtMaterialStylePrivate::init() +void StylePrivate::init() { - Q_Q(QtMaterialStyle); + Q_Q(Style); QFontDatabase::addApplicationFont(":/fonts/roboto_regular"); QFontDatabase::addApplicationFont(":/fonts/roboto_medium"); QFontDatabase::addApplicationFont(":/fonts/roboto_bold"); - q->setTheme(new QtMaterialTheme); + q->setTheme(new Theme); } /*! @@ -32,26 +34,28 @@ void QtMaterialStylePrivate::init() * \internal */ -void QtMaterialStyle::setTheme(QtMaterialTheme *theme) +void Style::setTheme(Theme *theme) { - Q_D(QtMaterialStyle); + Q_D(Style); d->theme = theme; theme->setParent(this); } -QColor QtMaterialStyle::themeColor(const QString &key) const +QColor Style::themeColor(const QString &key) const { - Q_D(const QtMaterialStyle); + Q_D(const Style); Q_ASSERT(d->theme); return d->theme->getColor(key); } -QtMaterialStyle::QtMaterialStyle() +Style::Style() : QCommonStyle(), - d_ptr(new QtMaterialStylePrivate(this)) + d_ptr(new StylePrivate(this)) { d_func()->init(); } + +} diff --git a/components/lib/qtmaterialstyle.h b/components/lib/qtmaterialstyle.h index e16289b0f..ce545dba0 100644 --- a/components/lib/qtmaterialstyle.h +++ b/components/lib/qtmaterialstyle.h @@ -7,34 +7,37 @@ #define MATERIAL_DISABLE_THEME_COLORS \ if (d->useThemeColors == true) { d->useThemeColors = false; } -class QtMaterialTheme; +namespace md +{ +class Theme; -class QtMaterialStyle : public QCommonStyle +class Style : public QCommonStyle { Q_OBJECT public: - inline static QtMaterialStyle &instance(); + inline static Style &instance(); - void setTheme(QtMaterialTheme *theme); + void setTheme(Theme *theme); QColor themeColor(const QString &key) const; protected: - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DECLARE_PRIVATE(QtMaterialStyle) + Q_DECLARE_PRIVATE(Style) - QtMaterialStyle(); + Style(); - QtMaterialStyle(QtMaterialStyle const &); - void operator=(QtMaterialStyle const &); + Style(Style const &); + void operator=(Style const &); }; -inline QtMaterialStyle &QtMaterialStyle::instance() +inline Style &Style::instance() { - static QtMaterialStyle instance; + static Style instance; return instance; } +} #endif // QTMATERIALSTYLE_H diff --git a/components/lib/qtmaterialstyle_p.h b/components/lib/qtmaterialstyle_p.h index d59ca4198..3c1745101 100644 --- a/components/lib/qtmaterialstyle_p.h +++ b/components/lib/qtmaterialstyle_p.h @@ -3,22 +3,25 @@ #include -class QtMaterialStyle; -class QtMaterialTheme; +namespace md +{ +class Style; +class Theme; -class QtMaterialStylePrivate +class StylePrivate { - Q_DISABLE_COPY(QtMaterialStylePrivate) - Q_DECLARE_PUBLIC(QtMaterialStyle) + Q_DISABLE_COPY(StylePrivate) + Q_DECLARE_PUBLIC(Style) public: - QtMaterialStylePrivate(QtMaterialStyle *q); - ~QtMaterialStylePrivate(); + StylePrivate(Style *q); + ~StylePrivate(); void init(); - QtMaterialStyle *const q_ptr; - QtMaterialTheme *theme; + Style *const q_ptr; + Theme *theme; }; +} #endif // QTMATERIALSTYLE_P_H diff --git a/components/lib/qtmaterialtheme.cpp b/components/lib/qtmaterialtheme.cpp index 725c95480..4340d6ffa 100644 --- a/components/lib/qtmaterialtheme.cpp +++ b/components/lib/qtmaterialtheme.cpp @@ -3,22 +3,23 @@ #include #include #include - +namespace md +{ /*!material * \class QtMaterialThemePrivate * \internal */ -QtMaterialThemePrivate::QtMaterialThemePrivate(QtMaterialTheme *q) +ThemePrivate::ThemePrivate(Theme *q) : q_ptr(q) { } -QtMaterialThemePrivate::~QtMaterialThemePrivate() +ThemePrivate::~ThemePrivate() { } -QColor QtMaterialThemePrivate::rgba(int r, int g, int b, qreal a) const +QColor ThemePrivate::rgba(int r, int g, int b, qreal a) const { QColor color(r, g, b); color.setAlphaF(a); @@ -29,9 +30,9 @@ QColor QtMaterialThemePrivate::rgba(int r, int g, int b, qreal a) const * \class QtMaterialTheme */ -QtMaterialTheme::QtMaterialTheme(QObject *parent) +Theme::Theme(QObject *parent) : QObject(parent), - d_ptr(new QtMaterialThemePrivate(this)) + d_ptr(new ThemePrivate(this)) { setColor("primary1", Material::cyan500); setColor("primary2", Material::cyan700); @@ -48,13 +49,13 @@ QtMaterialTheme::QtMaterialTheme(QObject *parent) setColor("disabled3", Material::grey300); } -QtMaterialTheme::~QtMaterialTheme() +Theme::~Theme() { } -QColor QtMaterialTheme::getColor(const QString &key) const +QColor Theme::getColor(const QString &key) const { - Q_D(const QtMaterialTheme); + Q_D(const Theme); if (!d->colors.contains(key)) { qWarning() << "A theme color matching the key '" << key << "' could not be found."; @@ -63,16 +64,16 @@ QColor QtMaterialTheme::getColor(const QString &key) const return d->colors.value(key); } -void QtMaterialTheme::setColor(const QString &key, const QColor &color) +void Theme::setColor(const QString &key, const QColor &color) { - Q_D(QtMaterialTheme); + Q_D(Theme); d->colors.insert(key, color); } -void QtMaterialTheme::setColor(const QString &key, Material::Color color) +void Theme::setColor(const QString &key, Material::Color color) { - Q_D(QtMaterialTheme); + Q_D(Theme); static const QColor palette[] = { QColor("#ffebee"), QColor("#ffcdd2"), QColor("#ef9a9a"), QColor("#e57373"), @@ -153,7 +154,9 @@ void QtMaterialTheme::setColor(const QString &key, Material::Color color) d->colors.insert(key, palette[color]); } -QIcon QtMaterialTheme::icon(QString category, QString icon) +QIcon Theme::icon(QString category, QString icon) { return QIcon(":/icons/icons/" % category % "/svg/production/ic_" % icon % "_24px.svg"); } + +} diff --git a/components/lib/qtmaterialtheme.h b/components/lib/qtmaterialtheme.h index fe4a11c82..37a843456 100644 --- a/components/lib/qtmaterialtheme.h +++ b/components/lib/qtmaterialtheme.h @@ -6,6 +6,8 @@ #include #include +namespace md +{ namespace Material { enum ButtonPreset { @@ -316,15 +318,15 @@ namespace Material }; } -class QtMaterialThemePrivate; +class ThemePrivate; -class QtMaterialTheme : public QObject +class Theme : public QObject { Q_OBJECT public: - explicit QtMaterialTheme(QObject *parent = 0); - ~QtMaterialTheme(); + explicit Theme(QObject *parent = 0); + ~Theme(); QColor getColor(const QString &key) const; @@ -334,11 +336,12 @@ class QtMaterialTheme : public QObject static QIcon icon(QString category, QString icon); protected: - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QtMaterialTheme) - Q_DECLARE_PRIVATE(QtMaterialTheme) + Q_DISABLE_COPY(Theme) + Q_DECLARE_PRIVATE(Theme) }; +} #endif // QTMATERIALTHEME_H diff --git a/components/lib/qtmaterialtheme_p.h b/components/lib/qtmaterialtheme_p.h index d0ef17839..988dabc36 100644 --- a/components/lib/qtmaterialtheme_p.h +++ b/components/lib/qtmaterialtheme_p.h @@ -4,21 +4,24 @@ #include #include -class QtMaterialTheme; +namespace md +{ +class Theme; -class QtMaterialThemePrivate +class ThemePrivate { - Q_DISABLE_COPY(QtMaterialThemePrivate) - Q_DECLARE_PUBLIC(QtMaterialTheme) + Q_DISABLE_COPY(ThemePrivate) + Q_DECLARE_PUBLIC(Theme) public: - QtMaterialThemePrivate(QtMaterialTheme *q); - ~QtMaterialThemePrivate(); + ThemePrivate(Theme *q); + ~ThemePrivate(); QColor rgba(int r, int g, int b, qreal a) const; - QtMaterialTheme *const q_ptr; + Theme *const q_ptr; QHash colors; }; +} #endif // QTMATERIALTHEME_P_H From 168ac029bf0dc5e47ca1530f424255b65c116ca3 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 03:06:23 +0100 Subject: [PATCH 14/46] Badge moved to md. --- components/qtmaterialbadge.cpp | 115 +++++++++++++++++---------------- components/qtmaterialbadge.h | 22 ++++--- components/qtmaterialbadge_p.h | 17 +++-- 3 files changed, 83 insertions(+), 71 deletions(-) diff --git a/components/qtmaterialbadge.cpp b/components/qtmaterialbadge.cpp index b30aa95ba..71046feba 100644 --- a/components/qtmaterialbadge.cpp +++ b/components/qtmaterialbadge.cpp @@ -3,6 +3,9 @@ #include #include "lib/qtmaterialstyle.h" +namespace md +{ + /*! * \class QtMaterialBadgePrivate * \internal @@ -11,7 +14,7 @@ /*! * \internal */ -QtMaterialBadgePrivate::QtMaterialBadgePrivate(QtMaterialBadge *q) +BadgePrivate::BadgePrivate(Badge *q) : q_ptr(q) { } @@ -19,16 +22,16 @@ QtMaterialBadgePrivate::QtMaterialBadgePrivate(QtMaterialBadge *q) /*! * \internal */ -QtMaterialBadgePrivate::~QtMaterialBadgePrivate() +BadgePrivate::~BadgePrivate() { } /*! * \internal */ -void QtMaterialBadgePrivate::init() +void BadgePrivate::init() { - Q_Q(QtMaterialBadge); + Q_Q(Badge); x = 0; y = 0; @@ -49,38 +52,38 @@ void QtMaterialBadgePrivate::init() * \class QtMaterialBadge */ -QtMaterialBadge::QtMaterialBadge(QWidget *parent) - : QtMaterialOverlayWidget(parent), - d_ptr(new QtMaterialBadgePrivate(this)) +Badge::Badge(QWidget *parent) + : OverlayWidget(parent), + d_ptr(new BadgePrivate(this)) { d_func()->init(); } -QtMaterialBadge::QtMaterialBadge(const QIcon &icon, QWidget *parent) - : QtMaterialOverlayWidget(parent), - d_ptr(new QtMaterialBadgePrivate(this)) +Badge::Badge(const QIcon &icon, QWidget *parent) + : OverlayWidget(parent), + d_ptr(new BadgePrivate(this)) { d_func()->init(); setIcon(icon); } -QtMaterialBadge::QtMaterialBadge(const QString &text, QWidget *parent) - : QtMaterialOverlayWidget(parent), - d_ptr(new QtMaterialBadgePrivate(this)) +Badge::Badge(const QString &text, QWidget *parent) + : OverlayWidget(parent), + d_ptr(new BadgePrivate(this)) { d_func()->init(); setText(text); } -QtMaterialBadge::~QtMaterialBadge() +Badge::~Badge() { } -void QtMaterialBadge::setUseThemeColors(bool value) +void Badge::setUseThemeColors(bool value) { - Q_D(QtMaterialBadge); + Q_D(Badge); if (d->useThemeColors == value) { return; @@ -90,16 +93,16 @@ void QtMaterialBadge::setUseThemeColors(bool value) update(); } -bool QtMaterialBadge::useThemeColors() const +bool Badge::useThemeColors() const { - Q_D(const QtMaterialBadge); + Q_D(const Badge); return d->useThemeColors; } -void QtMaterialBadge::setTextColor(const QColor &color) +void Badge::setTextColor(const QColor &color) { - Q_D(QtMaterialBadge); + Q_D(Badge); d->textColor = color; @@ -107,20 +110,20 @@ void QtMaterialBadge::setTextColor(const QColor &color) update(); } -QColor QtMaterialBadge::textColor() const +QColor Badge::textColor() const { - Q_D(const QtMaterialBadge); + Q_D(const Badge); if (d->useThemeColors || !d->textColor.isValid()) { - return QtMaterialStyle::instance().themeColor("canvas"); + return Style::instance().themeColor("canvas"); } else { return d->textColor; } } -void QtMaterialBadge::setBackgroundColor(const QColor &color) +void Badge::setBackgroundColor(const QColor &color) { - Q_D(QtMaterialBadge); + Q_D(Badge); d->backgroundColor = color; @@ -128,64 +131,64 @@ void QtMaterialBadge::setBackgroundColor(const QColor &color) update(); } -QColor QtMaterialBadge::backgroundColor() const +QColor Badge::backgroundColor() const { - Q_D(const QtMaterialBadge); + Q_D(const Badge); if (d->useThemeColors || !d->backgroundColor.isValid()) { - return QtMaterialStyle::instance().themeColor("accent1"); + return Style::instance().themeColor("accent1"); } else { return d->backgroundColor; } } -void QtMaterialBadge::setRelativePosition(const QPointF &pos) +void Badge::setRelativePosition(const QPointF &pos) { setRelativePosition(pos.x(), pos.y()); } -void QtMaterialBadge::setRelativePosition(qreal x, qreal y) +void Badge::setRelativePosition(qreal x, qreal y) { - Q_D(QtMaterialBadge); + Q_D(Badge); d->x = x; d->y = y; update(); } -QPointF QtMaterialBadge::relativePosition() const +QPointF Badge::relativePosition() const { - Q_D(const QtMaterialBadge); + Q_D(const Badge); return QPointF(d->x, d->y); } -void QtMaterialBadge::setRelativeXPosition(qreal x) +void Badge::setRelativeXPosition(qreal x) { - Q_D(QtMaterialBadge); + Q_D(Badge); d->x = x; update(); } -qreal QtMaterialBadge::relativeXPosition() const +qreal Badge::relativeXPosition() const { - Q_D(const QtMaterialBadge); + Q_D(const Badge); return d->x; } -void QtMaterialBadge::setRelativeYPosition(qreal y) +void Badge::setRelativeYPosition(qreal y) { - Q_D(QtMaterialBadge); + Q_D(Badge); d->y = y; update(); } -qreal QtMaterialBadge::relativeYPosition() const +qreal Badge::relativeYPosition() const { - Q_D(const QtMaterialBadge); + Q_D(const Badge); return d->y; } @@ -193,30 +196,30 @@ qreal QtMaterialBadge::relativeYPosition() const /*! * \reimp */ -QSize QtMaterialBadge::sizeHint() const +QSize Badge::sizeHint() const { const int s = getDiameter(); return QSize(s+4, s+4); } -void QtMaterialBadge::setIcon(const QIcon &icon) +void Badge::setIcon(const QIcon &icon) { - Q_D(QtMaterialBadge); + Q_D(Badge); d->icon = icon; update(); } -QIcon QtMaterialBadge::icon() const +QIcon Badge::icon() const { - Q_D(const QtMaterialBadge); + Q_D(const Badge); return d->icon; } -void QtMaterialBadge::setText(const QString &text) +void Badge::setText(const QString &text) { - Q_D(QtMaterialBadge); + Q_D(Badge); d->text = text; @@ -229,9 +232,9 @@ void QtMaterialBadge::setText(const QString &text) update(); } -QString QtMaterialBadge::text() const +QString Badge::text() const { - Q_D(const QtMaterialBadge); + Q_D(const Badge); return d->text; } @@ -239,11 +242,11 @@ QString QtMaterialBadge::text() const /*! * \reimp */ -void QtMaterialBadge::paintEvent(QPaintEvent *event) +void Badge::paintEvent(QPaintEvent *event) { Q_UNUSED(event) - Q_D(QtMaterialBadge); + Q_D(Badge); QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); @@ -253,7 +256,7 @@ void QtMaterialBadge::paintEvent(QPaintEvent *event) QBrush brush; brush.setStyle(Qt::SolidPattern); brush.setColor(isEnabled() ? backgroundColor() - : QtMaterialStyle::instance().themeColor("disabled")); + : Style::instance().themeColor("disabled")); painter.setBrush(brush); painter.setPen(Qt::NoPen); @@ -282,9 +285,9 @@ void QtMaterialBadge::paintEvent(QPaintEvent *event) } } -int QtMaterialBadge::getDiameter() const +int Badge::getDiameter() const { - Q_D(const QtMaterialBadge); + Q_D(const Badge); if (d->icon.isNull()) { return qMax(d->size.width(), d->size.height()) + d->padding; @@ -292,3 +295,5 @@ int QtMaterialBadge::getDiameter() const return 24; } } + +} diff --git a/components/qtmaterialbadge.h b/components/qtmaterialbadge.h index deac3ab4b..8df8dffa1 100644 --- a/components/qtmaterialbadge.h +++ b/components/qtmaterialbadge.h @@ -2,10 +2,12 @@ #define QTMATERIALBADGE_H #include "lib/qtmaterialoverlaywidget.h" +namespace md +{ -class QtMaterialBadgePrivate; +class BadgePrivate; -class QtMaterialBadge : public QtMaterialOverlayWidget +class Badge : public OverlayWidget { Q_OBJECT @@ -14,10 +16,10 @@ class QtMaterialBadge : public QtMaterialOverlayWidget Q_PROPERTY(QPointF relativePosition WRITE setRelativePosition READ relativePosition) public: - explicit QtMaterialBadge(QWidget *parent = 0); - explicit QtMaterialBadge(const QIcon &icon, QWidget *parent = 0); - explicit QtMaterialBadge(const QString &text, QWidget *parent = 0); - ~QtMaterialBadge(); + explicit Badge(QWidget *parent = 0); + explicit Badge(const QIcon &icon, QWidget *parent = 0); + explicit Badge(const QString &text, QWidget *parent = 0); + ~Badge(); void setUseThemeColors(bool value); bool useThemeColors() const; @@ -51,11 +53,13 @@ class QtMaterialBadge : public QtMaterialOverlayWidget int getDiameter() const; - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QtMaterialBadge) - Q_DECLARE_PRIVATE(QtMaterialBadge) + Q_DISABLE_COPY(Badge) + Q_DECLARE_PRIVATE(Badge) }; +} + #endif // QTMATERIALBADGE_H diff --git a/components/qtmaterialbadge_p.h b/components/qtmaterialbadge_p.h index 19757e7bb..c72d5a492 100644 --- a/components/qtmaterialbadge_p.h +++ b/components/qtmaterialbadge_p.h @@ -6,20 +6,22 @@ #include #include -class QtMaterialBadge; +namespace md +{ +class Badge; -class QtMaterialBadgePrivate +class BadgePrivate { - Q_DISABLE_COPY(QtMaterialBadgePrivate) - Q_DECLARE_PUBLIC(QtMaterialBadge) + Q_DISABLE_COPY(BadgePrivate) + Q_DECLARE_PUBLIC(Badge) public: - QtMaterialBadgePrivate(QtMaterialBadge *q); - ~QtMaterialBadgePrivate(); + BadgePrivate(Badge *q); + ~BadgePrivate(); void init(); - QtMaterialBadge *const q_ptr; + Badge *const q_ptr; QString text; QColor textColor; QColor backgroundColor; @@ -30,5 +32,6 @@ class QtMaterialBadgePrivate int padding; bool useThemeColors; }; +} #endif // QTMATERIALBADGE_P_H From 336b50e2ad9679fd74c64c1f294724e77b20dea7 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 03:10:25 +0100 Subject: [PATCH 15/46] CkechBox moved. --- components/qtmaterialcheckbox.cpp | 20 ++++++++++++-------- components/qtmaterialcheckbox.h | 16 ++++++++++------ components/qtmaterialcheckbox_p.h | 16 +++++++++------- 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/components/qtmaterialcheckbox.cpp b/components/qtmaterialcheckbox.cpp index b693a90d9..4d4122c9c 100644 --- a/components/qtmaterialcheckbox.cpp +++ b/components/qtmaterialcheckbox.cpp @@ -4,6 +4,8 @@ #include #include #include "lib/qtmaterialcheckable_internal.h" +namespace md +{ /*! * \class QtMaterialCheckBoxPrivate @@ -13,24 +15,24 @@ /*! * \internal */ -QtMaterialCheckBoxPrivate::QtMaterialCheckBoxPrivate(QtMaterialCheckBox *q) - : QtMaterialCheckablePrivate(q) +CheckBoxPrivate::CheckBoxPrivate(CheckBox *q) + : CheckablePrivate(q) { } /*! * \internal */ -QtMaterialCheckBoxPrivate::~QtMaterialCheckBoxPrivate() +CheckBoxPrivate::~CheckBoxPrivate() { } /*! * \internal */ -void QtMaterialCheckBoxPrivate::init() +void CheckBoxPrivate::init() { - Q_Q(QtMaterialCheckBox); + Q_Q(CheckBox); checkedState->assignProperty(checkedIcon, "iconSize", 24); uncheckedState->assignProperty(checkedIcon, "iconSize", 0); @@ -74,12 +76,14 @@ void QtMaterialCheckBoxPrivate::init() * \class QtMaterialCheckBox */ -QtMaterialCheckBox::QtMaterialCheckBox(QWidget *parent) - : QtMaterialCheckable(*new QtMaterialCheckBoxPrivate(this), parent) +CheckBox::CheckBox(QWidget *parent) + : Checkable(*new CheckBoxPrivate(this), parent) { d_func()->init(); } -QtMaterialCheckBox::~QtMaterialCheckBox() +CheckBox::~CheckBox() { } + +} diff --git a/components/qtmaterialcheckbox.h b/components/qtmaterialcheckbox.h index 5aaa8f4dc..b09de4f03 100644 --- a/components/qtmaterialcheckbox.h +++ b/components/qtmaterialcheckbox.h @@ -3,19 +3,23 @@ #include "lib/qtmaterialcheckable.h" -class QtMaterialCheckBoxPrivate; +namespace md +{ + +class CheckBoxPrivate; -class QtMaterialCheckBox : public QtMaterialCheckable +class CheckBox : public Checkable { Q_OBJECT public: - explicit QtMaterialCheckBox(QWidget *parent = 0); - ~QtMaterialCheckBox(); + explicit CheckBox(QWidget *parent = 0); + ~CheckBox(); private: - Q_DISABLE_COPY(QtMaterialCheckBox) - Q_DECLARE_PRIVATE(QtMaterialCheckBox) + Q_DISABLE_COPY(CheckBox) + Q_DECLARE_PRIVATE(CheckBox) }; +} #endif // QTMATERIALCHECKBOX_H diff --git a/components/qtmaterialcheckbox_p.h b/components/qtmaterialcheckbox_p.h index daa62d796..c79f9def3 100644 --- a/components/qtmaterialcheckbox_p.h +++ b/components/qtmaterialcheckbox_p.h @@ -2,19 +2,21 @@ #define QTMATERIALCHECKBOX_P_H #include "lib/qtmaterialcheckable_p.h" +namespace md +{ -class QtMaterialCheckBox; +class CheckBox; -class QtMaterialCheckBoxPrivate : public QtMaterialCheckablePrivate +class CheckBoxPrivate : public CheckablePrivate { - Q_DISABLE_COPY(QtMaterialCheckBoxPrivate) - Q_DECLARE_PUBLIC(QtMaterialCheckBox) + Q_DISABLE_COPY(CheckBoxPrivate) + Q_DECLARE_PUBLIC(CheckBox) public: - QtMaterialCheckBoxPrivate(QtMaterialCheckBox *q); - ~QtMaterialCheckBoxPrivate(); + CheckBoxPrivate(CheckBox *q); + ~CheckBoxPrivate(); void init(); }; - +} #endif // QTMATERIALCHECKBOX_P_H From 597ad493fb5536115153a9a1eb516109357f725b Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 03:15:21 +0100 Subject: [PATCH 16/46] Dialog moved --- components/qtmaterialdialog.cpp | 53 +++++++++++++----------- components/qtmaterialdialog.h | 18 ++++---- components/qtmaterialdialog_internal.cpp | 36 +++++++++------- components/qtmaterialdialog_internal.h | 33 ++++++++------- components/qtmaterialdialog_p.h | 26 ++++++------ 5 files changed, 90 insertions(+), 76 deletions(-) diff --git a/components/qtmaterialdialog.cpp b/components/qtmaterialdialog.cpp index 82afc898f..109f50eec 100644 --- a/components/qtmaterialdialog.cpp +++ b/components/qtmaterialdialog.cpp @@ -9,29 +9,31 @@ #include #include "qtmaterialdialog_internal.h" #include "lib/qtmaterialstatetransition.h" +namespace md +{ /*! * \class QtMaterialDialogPrivate * \internal */ -QtMaterialDialogPrivate::QtMaterialDialogPrivate(QtMaterialDialog *q) +DialogPrivate::DialogPrivate(Dialog *q) : q_ptr(q) { } -QtMaterialDialogPrivate::~QtMaterialDialogPrivate() +DialogPrivate::~DialogPrivate() { } -void QtMaterialDialogPrivate::init() +void DialogPrivate::init() { - Q_Q(QtMaterialDialog); + Q_Q(Dialog); - dialogWindow = new QtMaterialDialogWindow(q); + dialogWindow = new DialogWindow(q); proxyStack = new QStackedLayout; stateMachine = new QStateMachine(q); - proxy = new QtMaterialDialogProxy(dialogWindow, proxyStack, q); + proxy = new DialogProxy(dialogWindow, proxyStack, q); QVBoxLayout *layout = new QVBoxLayout; q->setLayout(layout); @@ -62,13 +64,13 @@ void QtMaterialDialogPrivate::init() stateMachine->addState(visibleState); stateMachine->setInitialState(hiddenState); - QtMaterialStateTransition *transition; + StateTransition *transition; - transition = new QtMaterialStateTransition(DialogShowTransition); + transition = new StateTransition(DialogShowTransition); transition->setTargetState(visibleState); hiddenState->addTransition(transition); - transition = new QtMaterialStateTransition(DialogHideTransition); + transition = new StateTransition(DialogHideTransition); transition->setTargetState(hiddenState); visibleState->addTransition(transition); @@ -107,53 +109,53 @@ void QtMaterialDialogPrivate::init() * \class QtMaterialDialog */ -QtMaterialDialog::QtMaterialDialog(QWidget *parent) - : QtMaterialOverlayWidget(parent), - d_ptr(new QtMaterialDialogPrivate(this)) +Dialog::Dialog(QWidget *parent) + : OverlayWidget(parent), + d_ptr(new DialogPrivate(this)) { d_func()->init(); } -QtMaterialDialog::~QtMaterialDialog() +Dialog::~Dialog() { } -QLayout *QtMaterialDialog::windowLayout() const +QLayout *Dialog::windowLayout() const { - Q_D(const QtMaterialDialog); + Q_D(const Dialog); return d->dialogWindow->layout(); } -void QtMaterialDialog::setWindowLayout(QLayout *layout) +void Dialog::setWindowLayout(QLayout *layout) { - Q_D(QtMaterialDialog); + Q_D(Dialog); d->dialogWindow->setLayout(layout); } -void QtMaterialDialog::showDialog() +void Dialog::showDialog() { - Q_D(QtMaterialDialog); + Q_D(Dialog); - d->stateMachine->postEvent(new QtMaterialStateTransitionEvent(DialogShowTransition)); + d->stateMachine->postEvent(new StateTransitionEvent(DialogShowTransition)); raise(); } -void QtMaterialDialog::hideDialog() +void Dialog::hideDialog() { - Q_D(QtMaterialDialog); + Q_D(Dialog); - d->stateMachine->postEvent(new QtMaterialStateTransitionEvent(DialogHideTransition)); + d->stateMachine->postEvent(new StateTransitionEvent(DialogHideTransition)); setAttribute(Qt::WA_TransparentForMouseEvents); d->proxyStack->setCurrentIndex(1); } -void QtMaterialDialog::paintEvent(QPaintEvent *event) +void Dialog::paintEvent(QPaintEvent *event) { Q_UNUSED(event) - Q_D(QtMaterialDialog); + Q_D(Dialog); QPainter painter(this); @@ -165,3 +167,4 @@ void QtMaterialDialog::paintEvent(QPaintEvent *event) painter.setOpacity(d->proxy->opacity()/2.4); painter.drawRect(rect()); } +} diff --git a/components/qtmaterialdialog.h b/components/qtmaterialdialog.h index 822a5d9f6..af40fcfda 100644 --- a/components/qtmaterialdialog.h +++ b/components/qtmaterialdialog.h @@ -3,17 +3,19 @@ #include #include "lib/qtmaterialoverlaywidget.h" +namespace md +{ class QLayout; -class QtMaterialDialogPrivate; +class DialogPrivate; -class QtMaterialDialog : public QtMaterialOverlayWidget +class Dialog : public OverlayWidget { Q_OBJECT public: - explicit QtMaterialDialog(QWidget *parent = 0); - ~QtMaterialDialog(); + explicit Dialog(QWidget *parent = 0); + ~Dialog(); QLayout *windowLayout() const; void setWindowLayout(QLayout *layout); @@ -25,11 +27,11 @@ public slots: protected: void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QtMaterialDialog) - Q_DECLARE_PRIVATE(QtMaterialDialog) + Q_DISABLE_COPY(Dialog) + Q_DECLARE_PRIVATE(Dialog) }; - +} #endif // QTMATERIALDIALOG_H diff --git a/components/qtmaterialdialog_internal.cpp b/components/qtmaterialdialog_internal.cpp index 6cac9b8c9..9780f8d1c 100644 --- a/components/qtmaterialdialog_internal.cpp +++ b/components/qtmaterialdialog_internal.cpp @@ -4,16 +4,18 @@ #include #include #include "qtmaterialdialog.h" +namespace md +{ /*! * \class QtMaterialDialogProxy * \internal */ -QtMaterialDialogProxy::QtMaterialDialogProxy( - QtMaterialDialogWindow *source, +DialogProxy::DialogProxy( + DialogWindow *source, QStackedLayout *layout, - QtMaterialDialog *dialog, + Dialog *dialog, QWidget *parent) : QWidget(parent), m_source(source), @@ -24,11 +26,11 @@ QtMaterialDialogProxy::QtMaterialDialogProxy( { } -QtMaterialDialogProxy::~QtMaterialDialogProxy() +DialogProxy::~DialogProxy() { } -void QtMaterialDialogProxy::setOpacity(qreal opacity) +void DialogProxy::setOpacity(qreal opacity) { m_opacity = opacity; m_mode = SemiTransparent; @@ -37,7 +39,7 @@ void QtMaterialDialogProxy::setOpacity(qreal opacity) } -void QtMaterialDialogProxy::makeOpaque() +void DialogProxy::makeOpaque() { m_dialog->setAttribute(Qt::WA_TransparentForMouseEvents, false); m_layout->setCurrentIndex(0); @@ -46,19 +48,19 @@ void QtMaterialDialogProxy::makeOpaque() update(); } -void QtMaterialDialogProxy::makeTransparent() +void DialogProxy::makeTransparent() { m_opacity = 0.0; m_mode = Transparent; update(); } -QSize QtMaterialDialogProxy::sizeHint() const +QSize DialogProxy::sizeHint() const { return m_source->sizeHint(); } -bool QtMaterialDialogProxy::event(QEvent *event) +bool DialogProxy::event(QEvent *event) { const QEvent::Type type = event->type(); @@ -68,7 +70,7 @@ bool QtMaterialDialogProxy::event(QEvent *event) return QWidget::event(event); } -void QtMaterialDialogProxy::paintEvent(QPaintEvent *event) +void DialogProxy::paintEvent(QPaintEvent *event) { Q_UNUSED(event) @@ -88,31 +90,31 @@ void QtMaterialDialogProxy::paintEvent(QPaintEvent *event) * \internal */ -QtMaterialDialogWindow::QtMaterialDialogWindow( - QtMaterialDialog *dialog, +DialogWindow::DialogWindow( + Dialog *dialog, QWidget *parent) : QWidget(parent), m_dialog(dialog) { } -QtMaterialDialogWindow::~QtMaterialDialogWindow() +DialogWindow::~DialogWindow() { } -void QtMaterialDialogWindow::setOffset(int offset) +void DialogWindow::setOffset(int offset) { QMargins margins = m_dialog->layout()->contentsMargins(); margins.setBottom(offset); m_dialog->layout()->setContentsMargins(margins); } -int QtMaterialDialogWindow::offset() const +int DialogWindow::offset() const { return m_dialog->layout()->contentsMargins().bottom(); } -void QtMaterialDialogWindow::paintEvent(QPaintEvent *event) +void DialogWindow::paintEvent(QPaintEvent *event) { Q_UNUSED(event) @@ -125,3 +127,5 @@ void QtMaterialDialogWindow::paintEvent(QPaintEvent *event) painter.setBrush(brush); painter.drawRect(rect()); } + +} diff --git a/components/qtmaterialdialog_internal.h b/components/qtmaterialdialog_internal.h index 52f5a0557..86695da12 100644 --- a/components/qtmaterialdialog_internal.h +++ b/components/qtmaterialdialog_internal.h @@ -2,12 +2,14 @@ #define QTMATERIALDIALOG_INTERNAL_H #include +namespace md +{ class QStackedLayout; -class QtMaterialDialog; -class QtMaterialDialogWindow; +class Dialog; +class DialogWindow; -class QtMaterialDialogProxy : public QWidget +class DialogProxy : public QWidget { Q_OBJECT @@ -20,11 +22,11 @@ class QtMaterialDialogProxy : public QWidget }; public: - QtMaterialDialogProxy(QtMaterialDialogWindow *source, + DialogProxy(DialogWindow *source, QStackedLayout *layout, - QtMaterialDialog *dialog, + Dialog *dialog, QWidget *parent = 0); - ~QtMaterialDialogProxy(); + ~DialogProxy(); void setOpacity(qreal opacity); inline qreal opacity() const; @@ -40,29 +42,29 @@ protected slots: void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(QtMaterialDialogProxy) + Q_DISABLE_COPY(DialogProxy) - QtMaterialDialogWindow *const m_source; + DialogWindow *const m_source; QStackedLayout *const m_layout; - QtMaterialDialog *const m_dialog; + Dialog *const m_dialog; qreal m_opacity; TransparencyMode m_mode; }; -inline qreal QtMaterialDialogProxy::opacity() const +inline qreal DialogProxy::opacity() const { return m_opacity; } -class QtMaterialDialogWindow : public QWidget +class DialogWindow : public QWidget { Q_OBJECT Q_PROPERTY(int offset WRITE setOffset READ offset) public: - explicit QtMaterialDialogWindow(QtMaterialDialog *dialog, QWidget *parent = 0); - ~QtMaterialDialogWindow(); + explicit DialogWindow(Dialog *dialog, QWidget *parent = 0); + ~DialogWindow(); void setOffset(int offset); int offset() const; @@ -71,9 +73,10 @@ class QtMaterialDialogWindow : public QWidget void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(QtMaterialDialogWindow) + Q_DISABLE_COPY(DialogWindow) - QtMaterialDialog *const m_dialog; + Dialog *const m_dialog; }; #endif // QTMATERIALDIALOG_INTERNAL_H +} diff --git a/components/qtmaterialdialog_p.h b/components/qtmaterialdialog_p.h index b10088ee1..f59fa1608 100644 --- a/components/qtmaterialdialog_p.h +++ b/components/qtmaterialdialog_p.h @@ -2,29 +2,31 @@ #define QTMATERIALDIALOG_P_H #include +namespace md +{ class QStateMachine; -class QtMaterialDialog; +class Dialog; class QStackedLayout; -class QtMaterialDialogWindow; -class QtMaterialDialogProxy; +class DialogWindow; +class DialogProxy; -class QtMaterialDialogPrivate +class DialogPrivate { - Q_DISABLE_COPY(QtMaterialDialogPrivate) - Q_DECLARE_PUBLIC(QtMaterialDialog) + Q_DISABLE_COPY(DialogPrivate) + Q_DECLARE_PUBLIC(Dialog) public: - QtMaterialDialogPrivate(QtMaterialDialog *q); - ~QtMaterialDialogPrivate(); + DialogPrivate(Dialog *q); + ~DialogPrivate(); void init(); - QtMaterialDialog *const q_ptr; - QtMaterialDialogWindow *dialogWindow; + Dialog *const q_ptr; + DialogWindow *dialogWindow; QStackedLayout *proxyStack; QStateMachine *stateMachine; - QtMaterialDialogProxy *proxy; + DialogProxy *proxy; }; - +} #endif // QTMATERIALDIALOG_P_H From 0e907a75c8e2ad89acb98166b8d308a7bc6ea7f4 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 03:22:22 +0100 Subject: [PATCH 17/46] Drawer moved. --- components/qtmaterialdrawer.cpp | 88 +++++++++++++----------- components/qtmaterialdrawer.h | 20 +++--- components/qtmaterialdrawer_internal.cpp | 29 ++++---- components/qtmaterialdrawer_internal.h | 33 +++++---- components/qtmaterialdrawer_p.h | 26 +++---- 5 files changed, 105 insertions(+), 91 deletions(-) diff --git a/components/qtmaterialdrawer.cpp b/components/qtmaterialdrawer.cpp index 1bddd4729..3ab6094d3 100644 --- a/components/qtmaterialdrawer.cpp +++ b/components/qtmaterialdrawer.cpp @@ -9,6 +9,8 @@ #include #include #include "qtmaterialdrawer_internal.h" +namespace md +{ /*! * \class QtMaterialDrawerPrivate @@ -18,7 +20,7 @@ /*! * \internal */ -QtMaterialDrawerPrivate::QtMaterialDrawerPrivate(QtMaterialDrawer *q) +DrawerPrivate::DrawerPrivate(Drawer *q) : q_ptr(q) { } @@ -26,19 +28,19 @@ QtMaterialDrawerPrivate::QtMaterialDrawerPrivate(QtMaterialDrawer *q) /*! * \internal */ -QtMaterialDrawerPrivate::~QtMaterialDrawerPrivate() +DrawerPrivate::~DrawerPrivate() { } /*! * \internal */ -void QtMaterialDrawerPrivate::init() +void DrawerPrivate::init() { - Q_Q(QtMaterialDrawer); + Q_Q(Drawer); - widget = new QtMaterialDrawerWidget; - stateMachine = new QtMaterialDrawerStateMachine(widget, q); + widget = new DrawerWidget; + stateMachine = new DrawerStateMachine(widget, q); window = new QWidget; width = 250; clickToClose = false; @@ -62,93 +64,93 @@ void QtMaterialDrawerPrivate::init() * \class QtMaterialDrawer */ -QtMaterialDrawer::QtMaterialDrawer(QWidget *parent) - : QtMaterialOverlayWidget(parent), - d_ptr(new QtMaterialDrawerPrivate(this)) +Drawer::Drawer(QWidget *parent) + : OverlayWidget(parent), + d_ptr(new DrawerPrivate(this)) { d_func()->init(); } -QtMaterialDrawer::~QtMaterialDrawer() +Drawer::~Drawer() { } -void QtMaterialDrawer::setDrawerWidth(int width) +void Drawer::setDrawerWidth(int width) { - Q_D(QtMaterialDrawer); + Q_D(Drawer); d->width = width; d->stateMachine->updatePropertyAssignments(); d->widget->setFixedWidth(width+16); } -int QtMaterialDrawer::drawerWidth() const +int Drawer::drawerWidth() const { - Q_D(const QtMaterialDrawer); + Q_D(const Drawer); return d->width; } -void QtMaterialDrawer::setDrawerLayout(QLayout *layout) +void Drawer::setDrawerLayout(QLayout *layout) { - Q_D(QtMaterialDrawer); + Q_D(Drawer); d->window->setLayout(layout); } -QLayout *QtMaterialDrawer::drawerLayout() const +QLayout *Drawer::drawerLayout() const { - Q_D(const QtMaterialDrawer); + Q_D(const Drawer); return d->window->layout(); } -void QtMaterialDrawer::setClickOutsideToClose(bool state) +void Drawer::setClickOutsideToClose(bool state) { - Q_D(QtMaterialDrawer); + Q_D(Drawer); d->clickToClose = state; } -bool QtMaterialDrawer::clickOutsideToClose() const +bool Drawer::clickOutsideToClose() const { - Q_D(const QtMaterialDrawer); + Q_D(const Drawer); return d->clickToClose; } -void QtMaterialDrawer::setAutoRaise(bool state) +void Drawer::setAutoRaise(bool state) { - Q_D(QtMaterialDrawer); + Q_D(Drawer); d->autoRaise = state; } -bool QtMaterialDrawer::autoRaise() const +bool Drawer::autoRaise() const { - Q_D(const QtMaterialDrawer); + Q_D(const Drawer); return d->autoRaise; } -void QtMaterialDrawer::setOverlayMode(bool value) +void Drawer::setOverlayMode(bool value) { - Q_D(QtMaterialDrawer); + Q_D(Drawer); d->overlay = value; update(); } -bool QtMaterialDrawer::overlayMode() const +bool Drawer::overlayMode() const { - Q_D(const QtMaterialDrawer); + Q_D(const Drawer); return d->overlay; } -void QtMaterialDrawer::openDrawer() +void Drawer::openDrawer() { - Q_D(QtMaterialDrawer); + Q_D(Drawer); emit d->stateMachine->signalOpen(); @@ -159,9 +161,9 @@ void QtMaterialDrawer::openDrawer() setAttribute(Qt::WA_NoSystemBackground, false); } -void QtMaterialDrawer::closeDrawer() +void Drawer::closeDrawer() { - Q_D(QtMaterialDrawer); + Q_D(Drawer); emit d->stateMachine->signalClose(); @@ -171,9 +173,9 @@ void QtMaterialDrawer::closeDrawer() } } -bool QtMaterialDrawer::event(QEvent *event) +bool Drawer::event(QEvent *event) { - Q_D(QtMaterialDrawer); + Q_D(Drawer); switch (event->type()) { @@ -186,12 +188,12 @@ bool QtMaterialDrawer::event(QEvent *event) default: break; } - return QtMaterialOverlayWidget::event(event); + return OverlayWidget::event(event); } -bool QtMaterialDrawer::eventFilter(QObject *obj, QEvent *event) +bool Drawer::eventFilter(QObject *obj, QEvent *event) { - Q_D(QtMaterialDrawer); + Q_D(Drawer); switch (event->type()) { @@ -216,14 +218,14 @@ bool QtMaterialDrawer::eventFilter(QObject *obj, QEvent *event) default: break; } - return QtMaterialOverlayWidget::eventFilter(obj, event); + return OverlayWidget::eventFilter(obj, event); } -void QtMaterialDrawer::paintEvent(QPaintEvent *event) +void Drawer::paintEvent(QPaintEvent *event) { Q_UNUSED(event) - Q_D(QtMaterialDrawer); + Q_D(Drawer); if (!d->overlay || d->stateMachine->isInClosedState()) { return; @@ -232,3 +234,5 @@ void QtMaterialDrawer::paintEvent(QPaintEvent *event) painter.setOpacity(d->stateMachine->opacity()); painter.fillRect(rect(), Qt::SolidPattern); } + +} diff --git a/components/qtmaterialdrawer.h b/components/qtmaterialdrawer.h index 7bf3219a0..f6628ff5e 100644 --- a/components/qtmaterialdrawer.h +++ b/components/qtmaterialdrawer.h @@ -2,17 +2,19 @@ #define QTMATERIALDRAWER_H #include "lib/qtmaterialoverlaywidget.h" +namespace md +{ -class QtMaterialDrawerPrivate; -class QtMaterialDrawerStateMachine; +class DrawerPrivate; +class DrawerStateMachine; -class QtMaterialDrawer : public QtMaterialOverlayWidget +class Drawer : public OverlayWidget { Q_OBJECT public: - explicit QtMaterialDrawer(QWidget *parent = 0); - ~QtMaterialDrawer(); + explicit Drawer(QWidget *parent = 0); + ~Drawer(); void setDrawerWidth(int width); int drawerWidth() const; @@ -38,11 +40,11 @@ public slots: bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE; void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QtMaterialDrawer) - Q_DECLARE_PRIVATE(QtMaterialDrawer) + Q_DISABLE_COPY(Drawer) + Q_DECLARE_PRIVATE(Drawer) }; - +} #endif // QTMATERIALDRAWER_H diff --git a/components/qtmaterialdrawer_internal.cpp b/components/qtmaterialdrawer_internal.cpp index 7f327005d..3d354cb90 100644 --- a/components/qtmaterialdrawer_internal.cpp +++ b/components/qtmaterialdrawer_internal.cpp @@ -5,13 +5,14 @@ #include #include #include "qtmaterialdrawer.h" - +namespace md +{ /*! * \class QtMaterialDrawerStateMachine * \internal */ -QtMaterialDrawerStateMachine::QtMaterialDrawerStateMachine(QtMaterialDrawerWidget *drawer, QtMaterialDrawer *parent) +DrawerStateMachine::DrawerStateMachine(DrawerWidget *drawer, Drawer *parent) : QStateMachine(parent), m_drawer(drawer), m_main(parent), @@ -85,22 +86,22 @@ QtMaterialDrawerStateMachine::QtMaterialDrawerStateMachine(QtMaterialDrawerWidge updatePropertyAssignments(); } -QtMaterialDrawerStateMachine::~QtMaterialDrawerStateMachine() +DrawerStateMachine::~DrawerStateMachine() { } -void QtMaterialDrawerStateMachine::setOpacity(qreal opacity) +void DrawerStateMachine::setOpacity(qreal opacity) { m_opacity = opacity; m_main->update(); } -bool QtMaterialDrawerStateMachine::isInClosedState() const +bool DrawerStateMachine::isInClosedState() const { return m_closedState->active(); } -void QtMaterialDrawerStateMachine::updatePropertyAssignments() +void DrawerStateMachine::updatePropertyAssignments() { const qreal closedOffset = -(m_drawer->width()+32); @@ -119,17 +120,17 @@ void QtMaterialDrawerStateMachine::updatePropertyAssignments() * \internal */ -QtMaterialDrawerWidget::QtMaterialDrawerWidget(QWidget *parent) - : QtMaterialOverlayWidget(parent), +DrawerWidget::DrawerWidget(QWidget *parent) + : OverlayWidget(parent), m_offset(0) { } -QtMaterialDrawerWidget::~QtMaterialDrawerWidget() +DrawerWidget::~DrawerWidget() { } -void QtMaterialDrawerWidget::setOffset(int offset) +void DrawerWidget::setOffset(int offset) { m_offset = offset; @@ -140,7 +141,7 @@ void QtMaterialDrawerWidget::setOffset(int offset) update(); } -void QtMaterialDrawerWidget::paintEvent(QPaintEvent *event) +void DrawerWidget::paintEvent(QPaintEvent *event) { Q_UNUSED(event) @@ -163,7 +164,9 @@ void QtMaterialDrawerWidget::paintEvent(QPaintEvent *event) painter.drawRect(width()-16, 0, 16, height()); } -QRect QtMaterialDrawerWidget::overlayGeometry() const +QRect DrawerWidget::overlayGeometry() const { - return QtMaterialOverlayWidget::overlayGeometry().translated(m_offset, 0); + return OverlayWidget::overlayGeometry().translated(m_offset, 0); +} + } diff --git a/components/qtmaterialdrawer_internal.h b/components/qtmaterialdrawer_internal.h index 76d219db2..ca2d9ca01 100644 --- a/components/qtmaterialdrawer_internal.h +++ b/components/qtmaterialdrawer_internal.h @@ -4,19 +4,22 @@ #include #include "lib/qtmaterialoverlaywidget.h" -class QtMaterialDrawer; -class QtMaterialDrawerWidget; +namespace md +{ + +class Drawer; +class DrawerWidget; -class QtMaterialDrawerStateMachine : public QStateMachine +class DrawerStateMachine : public QStateMachine { Q_OBJECT Q_PROPERTY(qreal opacity WRITE setOpacity READ opacity) public: - explicit QtMaterialDrawerStateMachine(QtMaterialDrawerWidget *drawer, - QtMaterialDrawer *parent); - ~QtMaterialDrawerStateMachine(); + explicit DrawerStateMachine(DrawerWidget *drawer, + Drawer *parent); + ~DrawerStateMachine(); void setOpacity(qreal opacity); inline qreal opacity() const; @@ -30,10 +33,10 @@ class QtMaterialDrawerStateMachine : public QStateMachine void signalClose(); private: - Q_DISABLE_COPY(QtMaterialDrawerStateMachine) + Q_DISABLE_COPY(DrawerStateMachine) - QtMaterialDrawerWidget *const m_drawer; - QtMaterialDrawer *const m_main; + DrawerWidget *const m_drawer; + Drawer *const m_main; QState *const m_openingState; QState *const m_openedState; QState *const m_closingState; @@ -41,20 +44,20 @@ class QtMaterialDrawerStateMachine : public QStateMachine qreal m_opacity; }; -inline qreal QtMaterialDrawerStateMachine::opacity() const +inline qreal DrawerStateMachine::opacity() const { return m_opacity; } -class QtMaterialDrawerWidget : public QtMaterialOverlayWidget +class DrawerWidget : public OverlayWidget { Q_OBJECT Q_PROPERTY(int offset WRITE setOffset READ offset) public: - explicit QtMaterialDrawerWidget(QWidget *parent = 0); - ~QtMaterialDrawerWidget(); + explicit DrawerWidget(QWidget *parent = 0); + ~DrawerWidget(); void setOffset(int offset); inline int offset() const; @@ -68,9 +71,9 @@ class QtMaterialDrawerWidget : public QtMaterialOverlayWidget int m_offset; }; -inline int QtMaterialDrawerWidget::offset() const +inline int DrawerWidget::offset() const { return m_offset; } - +} #endif // DRAWER_INTERNAL_H diff --git a/components/qtmaterialdrawer_p.h b/components/qtmaterialdrawer_p.h index cdd064d12..aab0441a5 100644 --- a/components/qtmaterialdrawer_p.h +++ b/components/qtmaterialdrawer_p.h @@ -2,26 +2,28 @@ #define DRAWER_P_H #include +namespace md +{ -class QtMaterialDrawer; -class QtMaterialDrawerWidget; -class QtMaterialDrawerStateMachine; +class Drawer; +class DrawerWidget; +class DrawerStateMachine; -class QtMaterialDrawerPrivate +class DrawerPrivate { - Q_DISABLE_COPY(QtMaterialDrawerPrivate) - Q_DECLARE_PUBLIC(QtMaterialDrawer) + Q_DISABLE_COPY(DrawerPrivate) + Q_DECLARE_PUBLIC(Drawer) public: - QtMaterialDrawerPrivate(QtMaterialDrawer *q); - ~QtMaterialDrawerPrivate(); + DrawerPrivate(Drawer *q); + ~DrawerPrivate(); void init(); void setClosed(bool value = true); - QtMaterialDrawer *const q_ptr; - QtMaterialDrawerWidget *widget; - QtMaterialDrawerStateMachine *stateMachine; + Drawer *const q_ptr; + DrawerWidget *widget; + DrawerStateMachine *stateMachine; QWidget *window; int width; bool clickToClose; @@ -29,5 +31,5 @@ class QtMaterialDrawerPrivate bool closed; bool overlay; }; - +} #endif // DRAWER_P_H From 1788acd81cdc2b95b624a69ad92555a4aac03762 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 03:26:57 +0100 Subject: [PATCH 18/46] Fab moved.. --- components/qtmaterialfab.cpp | 100 ++++++++++++++++++----------------- components/qtmaterialfab.h | 16 +++--- components/qtmaterialfab_p.h | 20 +++---- 3 files changed, 72 insertions(+), 64 deletions(-) diff --git a/components/qtmaterialfab.cpp b/components/qtmaterialfab.cpp index 3c3de8a1f..c7e0479c8 100644 --- a/components/qtmaterialfab.cpp +++ b/components/qtmaterialfab.cpp @@ -5,6 +5,8 @@ #include #include #include "lib/qtmaterialrippleoverlay.h" +namespace md +{ /*! * \class QtMaterialFloatingActionButtonPrivate @@ -14,24 +16,24 @@ /*! * \internal */ -QtMaterialFloatingActionButtonPrivate::QtMaterialFloatingActionButtonPrivate(QtMaterialFloatingActionButton *q) - : QtMaterialRaisedButtonPrivate(q) +FloatingActionButtonPrivate::FloatingActionButtonPrivate(FloatingActionButton *q) + : RaisedButtonPrivate(q) { } /*! * \internal */ -QtMaterialFloatingActionButtonPrivate::~QtMaterialFloatingActionButtonPrivate() +FloatingActionButtonPrivate::~FloatingActionButtonPrivate() { } /*! * \internal */ -void QtMaterialFloatingActionButtonPrivate::init() +void FloatingActionButtonPrivate::init() { - Q_Q(QtMaterialFloatingActionButton); + Q_Q(FloatingActionButton); corner = Qt::BottomRightCorner; mini = false; @@ -54,9 +56,9 @@ void QtMaterialFloatingActionButtonPrivate::init() /*! * \internal */ -QRect QtMaterialFloatingActionButtonPrivate::fabGeometry() const +QRect FloatingActionButtonPrivate::fabGeometry() const { - Q_Q(const QtMaterialFloatingActionButton); + Q_Q(const FloatingActionButton); QWidget *parent = q->parentWidget(); if (!parent) { @@ -83,7 +85,7 @@ QRect QtMaterialFloatingActionButtonPrivate::fabGeometry() const /*! * \internal */ -void QtMaterialFloatingActionButtonPrivate::setupProperties() +void FloatingActionButtonPrivate::setupProperties() { if (mini) { effect->setColor(QColor(0, 0, 0, 80)); @@ -104,37 +106,37 @@ void QtMaterialFloatingActionButtonPrivate::setupProperties() * \class QtMaterialFloatingActionButton */ -QtMaterialFloatingActionButton::QtMaterialFloatingActionButton(const QIcon &icon, QWidget *parent) - : QtMaterialRaisedButton(*new QtMaterialFloatingActionButtonPrivate(this), parent) +FloatingActionButton::FloatingActionButton(const QIcon &icon, QWidget *parent) + : RaisedButton(*new FloatingActionButtonPrivate(this), parent) { d_func()->init(); setIcon(icon); } -QtMaterialFloatingActionButton::~QtMaterialFloatingActionButton() +FloatingActionButton::~FloatingActionButton() { } /*! * \reimp */ -QSize QtMaterialFloatingActionButton::sizeHint() const +QSize FloatingActionButton::sizeHint() const { - Q_D(const QtMaterialFloatingActionButton); + Q_D(const FloatingActionButton); if (d->mini) { - return QSize(QtMaterialFloatingActionButtonPrivate::MiniDiameter, - QtMaterialFloatingActionButtonPrivate::MiniDiameter); + return QSize(FloatingActionButtonPrivate::MiniDiameter, + FloatingActionButtonPrivate::MiniDiameter); } else { - return QSize(QtMaterialFloatingActionButtonPrivate::DefaultDiameter, - QtMaterialFloatingActionButtonPrivate::DefaultDiameter); + return QSize(FloatingActionButtonPrivate::DefaultDiameter, + FloatingActionButtonPrivate::DefaultDiameter); } } -void QtMaterialFloatingActionButton::setMini(bool state) +void FloatingActionButton::setMini(bool state) { - Q_D(QtMaterialFloatingActionButton); + Q_D(FloatingActionButton); if (d->mini == state) { return; @@ -151,16 +153,16 @@ void QtMaterialFloatingActionButton::setMini(bool state) update(); } -bool QtMaterialFloatingActionButton::isMini() const +bool FloatingActionButton::isMini() const { - Q_D(const QtMaterialFloatingActionButton); + Q_D(const FloatingActionButton); return d->mini; } -void QtMaterialFloatingActionButton::setCorner(Qt::Corner corner) +void FloatingActionButton::setCorner(Qt::Corner corner) { - Q_D(QtMaterialFloatingActionButton); + Q_D(FloatingActionButton); if (d->corner == corner) { return; @@ -171,16 +173,16 @@ void QtMaterialFloatingActionButton::setCorner(Qt::Corner corner) update(); } -Qt::Corner QtMaterialFloatingActionButton::corner() const +Qt::Corner FloatingActionButton::corner() const { - Q_D(const QtMaterialFloatingActionButton); + Q_D(const FloatingActionButton); return d->corner; } -void QtMaterialFloatingActionButton::setOffset(int x, int y) +void FloatingActionButton::setOffset(int x, int y) { - Q_D(QtMaterialFloatingActionButton); + Q_D(FloatingActionButton); d->offsX = x; d->offsY = y; @@ -188,41 +190,41 @@ void QtMaterialFloatingActionButton::setOffset(int x, int y) update(); } -QSize QtMaterialFloatingActionButton::offset() const +QSize FloatingActionButton::offset() const { - Q_D(const QtMaterialFloatingActionButton); + Q_D(const FloatingActionButton); return QSize(d->offsX, d->offsY); } -void QtMaterialFloatingActionButton::setXOffset(int x) +void FloatingActionButton::setXOffset(int x) { - Q_D(QtMaterialFloatingActionButton); + Q_D(FloatingActionButton); d->offsX = x; setGeometry(d->fabGeometry()); update(); } -int QtMaterialFloatingActionButton::xOffset() const +int FloatingActionButton::xOffset() const { - Q_D(const QtMaterialFloatingActionButton); + Q_D(const FloatingActionButton); return d->offsX; } -void QtMaterialFloatingActionButton::setYOffset(int y) +void FloatingActionButton::setYOffset(int y) { - Q_D(QtMaterialFloatingActionButton); + Q_D(FloatingActionButton); d->offsY = y; setGeometry(d->fabGeometry()); update(); } -int QtMaterialFloatingActionButton::yOffset() const +int FloatingActionButton::yOffset() const { - Q_D(const QtMaterialFloatingActionButton); + Q_D(const FloatingActionButton); return d->offsY; } @@ -230,12 +232,12 @@ int QtMaterialFloatingActionButton::yOffset() const /*! * \reimp */ -bool QtMaterialFloatingActionButton::event(QEvent *event) +bool FloatingActionButton::event(QEvent *event) { - Q_D(QtMaterialFloatingActionButton); + Q_D(FloatingActionButton); if (!parent()) { - return QtMaterialRaisedButton::event(event); + return RaisedButton::event(event); } switch (event->type()) { @@ -253,33 +255,33 @@ bool QtMaterialFloatingActionButton::event(QEvent *event) default: break; } - return QtMaterialRaisedButton::event(event); + return RaisedButton::event(event); } /*! * \reimp */ -bool QtMaterialFloatingActionButton::eventFilter(QObject *obj, QEvent *event) +bool FloatingActionButton::eventFilter(QObject *obj, QEvent *event) { const QEvent::Type type = event->type(); if (QEvent::Move == type || QEvent::Resize == type) { - Q_D(QtMaterialFloatingActionButton); + Q_D(FloatingActionButton); setGeometry(d->fabGeometry()); } - return QtMaterialRaisedButton::eventFilter(obj, event); + return RaisedButton::eventFilter(obj, event); } /*! * \reimp */ -void QtMaterialFloatingActionButton::paintEvent(QPaintEvent *event) +void FloatingActionButton::paintEvent(QPaintEvent *event) { Q_UNUSED(event) - Q_D(QtMaterialFloatingActionButton); + Q_D(FloatingActionButton); QRect square = QRect(0, 0, d->diameter(), d->diameter()); square.moveCenter(rect().center()); @@ -311,11 +313,13 @@ void QtMaterialFloatingActionButton::paintEvent(QPaintEvent *event) painter.drawPixmap(iconGeometry, pixmap); } -void QtMaterialFloatingActionButton::updateClipPath() +void FloatingActionButton::updateClipPath() { - Q_D(QtMaterialFloatingActionButton); + Q_D(FloatingActionButton); QPainterPath path; path.addEllipse(0, 0, d->diameter(), d->diameter()); d->rippleOverlay->setClipPath(path); } + +} diff --git a/components/qtmaterialfab.h b/components/qtmaterialfab.h index 78838b12b..9e23cc00a 100644 --- a/components/qtmaterialfab.h +++ b/components/qtmaterialfab.h @@ -2,16 +2,18 @@ #define QTMATERIALFAB_H #include "qtmaterialraisedbutton.h" +namespace md +{ -class QtMaterialFloatingActionButtonPrivate; +class FloatingActionButtonPrivate; -class QtMaterialFloatingActionButton : public QtMaterialRaisedButton +class FloatingActionButton : public RaisedButton { Q_OBJECT public: - explicit QtMaterialFloatingActionButton(const QIcon &icon, QWidget *parent = 0); - ~QtMaterialFloatingActionButton(); + explicit FloatingActionButton(const QIcon &icon, QWidget *parent = 0); + ~FloatingActionButton(); QSize sizeHint() const Q_DECL_OVERRIDE; @@ -38,9 +40,9 @@ class QtMaterialFloatingActionButton : public QtMaterialRaisedButton void updateClipPath() Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(QtMaterialFloatingActionButton) - Q_DECLARE_PRIVATE(QtMaterialFloatingActionButton) + Q_DISABLE_COPY(FloatingActionButton) + Q_DECLARE_PRIVATE(FloatingActionButton) }; - +} #endif // QTMATERIALFAB_H diff --git a/components/qtmaterialfab_p.h b/components/qtmaterialfab_p.h index fae2d3ae8..6cd73552d 100644 --- a/components/qtmaterialfab_p.h +++ b/components/qtmaterialfab_p.h @@ -2,13 +2,15 @@ #define QTMATERIALFAB_P_H #include "qtmaterialraisedbutton_p.h" +namespace md +{ -class QtMaterialFloatingActionButton; +class FloatingActionButton; -class QtMaterialFloatingActionButtonPrivate : public QtMaterialRaisedButtonPrivate +class FloatingActionButtonPrivate : public RaisedButtonPrivate { - Q_DISABLE_COPY(QtMaterialFloatingActionButtonPrivate) - Q_DECLARE_PUBLIC(QtMaterialFloatingActionButton) + Q_DISABLE_COPY(FloatingActionButtonPrivate) + Q_DECLARE_PUBLIC(FloatingActionButton) public: enum { @@ -21,8 +23,8 @@ class QtMaterialFloatingActionButtonPrivate : public QtMaterialRaisedButtonPriva MiniIconSize = 18 }; - QtMaterialFloatingActionButtonPrivate(QtMaterialFloatingActionButton *q); - ~QtMaterialFloatingActionButtonPrivate(); + FloatingActionButtonPrivate(FloatingActionButton *q); + ~FloatingActionButtonPrivate(); void init(); QRect fabGeometry() const; @@ -37,14 +39,14 @@ class QtMaterialFloatingActionButtonPrivate : public QtMaterialRaisedButtonPriva int offsY; }; -inline int QtMaterialFloatingActionButtonPrivate::diameter() const +inline int FloatingActionButtonPrivate::diameter() const { return mini ? MiniDiameter : DefaultDiameter; } -inline int QtMaterialFloatingActionButtonPrivate::iconSize() const +inline int FloatingActionButtonPrivate::iconSize() const { return mini ? MiniIconSize : DefaultIconSize; } - +} #endif // QTMATERIALFAB_P_H From ff93c8e77a0b4de065f59af268d57d79d2014dbc Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 03:33:48 +0100 Subject: [PATCH 19/46] ProgressBar moved. --- components/qtmaterialprogress.cpp | 63 +++++++++++----------- components/qtmaterialprogress_internal.cpp | 4 +- components/qtmaterialprogress_internal.h | 18 ++++--- components/qtmaterialprogress_p.h | 22 ++++---- 4 files changed, 57 insertions(+), 50 deletions(-) diff --git a/components/qtmaterialprogress.cpp b/components/qtmaterialprogress.cpp index 03b15b2f0..d4deaaa7a 100644 --- a/components/qtmaterialprogress.cpp +++ b/components/qtmaterialprogress.cpp @@ -5,26 +5,28 @@ #include #include "qtmaterialprogress_internal.h" #include "lib/qtmaterialstyle.h" +namespace md +{ /*! - * \class QtMaterialProgressPrivate + * \class ProgressBarPrivate * \internal */ -QtMaterialProgressPrivate::QtMaterialProgressPrivate(QtMaterialProgress *q) +ProgressBarPrivate::ProgressBarPrivate(ProgressBar *q) : q_ptr(q) { } -QtMaterialProgressPrivate::~QtMaterialProgressPrivate() +ProgressBarPrivate::~ProgressBarPrivate() { } -void QtMaterialProgressPrivate::init() +void ProgressBarPrivate::init() { - Q_Q(QtMaterialProgress); + Q_Q(ProgressBar); - delegate = new QtMaterialProgressDelegate(q); + delegate = new ProgressBarDelegate(q); progressType = Material::IndeterminateProgress; useThemeColors = true; @@ -46,35 +48,35 @@ void QtMaterialProgressPrivate::init() * \class QtMaterialProgress */ -QtMaterialProgress::QtMaterialProgress(QWidget *parent) +ProgressBar::ProgressBar(QWidget *parent) : QProgressBar(parent), - d_ptr(new QtMaterialProgressPrivate(this)) + d_ptr(new ProgressBarPrivate(this)) { d_func()->init(); } -QtMaterialProgress::~QtMaterialProgress() +ProgressBar::~ProgressBar() { } -void QtMaterialProgress::setProgressType(Material::ProgressType type) +void ProgressBar::setProgressType(Material::ProgressType type) { - Q_D(QtMaterialProgress); + Q_D(ProgressBar); d->progressType = type; update(); } -Material::ProgressType QtMaterialProgress::progressType() const +Material::ProgressType ProgressBar::progressType() const { - Q_D(const QtMaterialProgress); + Q_D(const ProgressBar); return d->progressType; } -void QtMaterialProgress::setUseThemeColors(bool state) +void ProgressBar::setUseThemeColors(bool state) { - Q_D(QtMaterialProgress); + Q_D(ProgressBar); if (d->useThemeColors == state) { return; @@ -84,16 +86,16 @@ void QtMaterialProgress::setUseThemeColors(bool state) update(); } -bool QtMaterialProgress::useThemeColors() const +bool ProgressBar::useThemeColors() const { - Q_D(const QtMaterialProgress); + Q_D(const ProgressBar); return d->useThemeColors; } -void QtMaterialProgress::setProgressColor(const QColor &color) +void ProgressBar::setProgressColor(const QColor &color) { - Q_D(QtMaterialProgress); + Q_D(ProgressBar); d->progressColor = color; @@ -101,20 +103,20 @@ void QtMaterialProgress::setProgressColor(const QColor &color) update(); } -QColor QtMaterialProgress::progressColor() const +QColor ProgressBar::progressColor() const { - Q_D(const QtMaterialProgress); + Q_D(const ProgressBar); if (d->useThemeColors || !d->progressColor.isValid()) { - return QtMaterialStyle::instance().themeColor("primary1"); + return Style::instance().themeColor("primary1"); } else { return d->progressColor; } } -void QtMaterialProgress::setBackgroundColor(const QColor &color) +void ProgressBar::setBackgroundColor(const QColor &color) { - Q_D(QtMaterialProgress); + Q_D(ProgressBar); d->backgroundColor = color; @@ -122,12 +124,12 @@ void QtMaterialProgress::setBackgroundColor(const QColor &color) update(); } -QColor QtMaterialProgress::backgroundColor() const +QColor ProgressBar::backgroundColor() const { - Q_D(const QtMaterialProgress); + Q_D(const ProgressBar); if (d->useThemeColors || !d->backgroundColor.isValid()) { - return QtMaterialStyle::instance().themeColor("border"); + return Style::instance().themeColor("border"); } else { return d->backgroundColor; } @@ -136,11 +138,11 @@ QColor QtMaterialProgress::backgroundColor() const /*! * \reimp */ -void QtMaterialProgress::paintEvent(QPaintEvent *event) +void ProgressBar::paintEvent(QPaintEvent *event) { Q_UNUSED(event) - Q_D(QtMaterialProgress); + Q_D(ProgressBar); QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); @@ -148,7 +150,7 @@ void QtMaterialProgress::paintEvent(QPaintEvent *event) QBrush brush; brush.setStyle(Qt::SolidPattern); brush.setColor(isEnabled() ? backgroundColor() - : QtMaterialStyle::instance().themeColor("disabled")); + : Style::instance().themeColor("disabled")); painter.setBrush(brush); painter.setPen(Qt::NoPen); @@ -171,3 +173,4 @@ void QtMaterialProgress::paintEvent(QPaintEvent *event) } } } +} diff --git a/components/qtmaterialprogress_internal.cpp b/components/qtmaterialprogress_internal.cpp index 0544baeba..d2b23616e 100644 --- a/components/qtmaterialprogress_internal.cpp +++ b/components/qtmaterialprogress_internal.cpp @@ -5,7 +5,7 @@ * \internal */ -QtMaterialProgressDelegate::QtMaterialProgressDelegate(QtMaterialProgress *parent) +ProgressBarDelegate::ProgressBarDelegate(ProgressBar *parent) : QObject(parent), m_progress(parent), m_offset(0) @@ -13,6 +13,6 @@ QtMaterialProgressDelegate::QtMaterialProgressDelegate(QtMaterialProgress *paren Q_ASSERT(parent); } -QtMaterialProgressDelegate::~QtMaterialProgressDelegate() +ProgressBarDelegate::~ProgressBarDelegate() { } diff --git a/components/qtmaterialprogress_internal.h b/components/qtmaterialprogress_internal.h index 811e3d6de..2f936ed41 100644 --- a/components/qtmaterialprogress_internal.h +++ b/components/qtmaterialprogress_internal.h @@ -3,36 +3,38 @@ #include #include "qtmaterialprogress.h" +namespace md +{ -class QtMaterialProgressDelegate : public QObject +class ProgressBarDelegate : public QObject { Q_OBJECT Q_PROPERTY(qreal offset WRITE setOffset READ offset) public: - QtMaterialProgressDelegate(QtMaterialProgress *parent); - ~QtMaterialProgressDelegate(); + ProgressBarDelegate(ProgressBar *parent); + ~ProgressBarDelegate(); inline void setOffset(qreal offset); inline qreal offset() const; private: - Q_DISABLE_COPY(QtMaterialProgressDelegate) + Q_DISABLE_COPY(ProgressBarDelegate) - QtMaterialProgress *const m_progress; + ProgressBar *const m_progress; qreal m_offset; }; -inline void QtMaterialProgressDelegate::setOffset(qreal offset) +inline void ProgressBarDelegate::setOffset(qreal offset) { m_offset = offset; m_progress->update(); } -inline qreal QtMaterialProgressDelegate::offset() const +inline qreal ProgressBarDelegate::offset() const { return m_offset; } - +} #endif // QTMATERIALPROGRESS_INTERNAL_H diff --git a/components/qtmaterialprogress_p.h b/components/qtmaterialprogress_p.h index b55fb021c..9256f5fce 100644 --- a/components/qtmaterialprogress_p.h +++ b/components/qtmaterialprogress_p.h @@ -4,27 +4,29 @@ #include #include #include "lib/qtmaterialtheme.h" +namespace md +{ -class QtMaterialProgress; -class QtMaterialProgressDelegate; +class ProgressBar; +class ProgressBarDelegate; -class QtMaterialProgressPrivate +class ProgressBarPrivate { - Q_DISABLE_COPY(QtMaterialProgressPrivate) - Q_DECLARE_PUBLIC(QtMaterialProgress) + Q_DISABLE_COPY(ProgressBarPrivate) + Q_DECLARE_PUBLIC(ProgressBar) public: - QtMaterialProgressPrivate(QtMaterialProgress *q); - ~QtMaterialProgressPrivate(); + ProgressBarPrivate(ProgressBar *q); + ~ProgressBarPrivate(); void init(); - QtMaterialProgress *const q_ptr; - QtMaterialProgressDelegate *delegate; + ProgressBar *const q_ptr; + ProgressBarDelegate *delegate; Material::ProgressType progressType; QColor progressColor; QColor backgroundColor; bool useThemeColors; }; - +} #endif // QTMATERIALPROGRESS_P_H From 1c07c06d8579e1e4c5545baf878ad34662217c38 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 03:35:26 +0100 Subject: [PATCH 20/46] ProgressBar moved - 2 --- components/qtmaterialprogress.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/components/qtmaterialprogress.h b/components/qtmaterialprogress.h index 0e69b1d3c..44bfeafe8 100644 --- a/components/qtmaterialprogress.h +++ b/components/qtmaterialprogress.h @@ -4,9 +4,12 @@ #include #include "lib/qtmaterialtheme.h" -class QtMaterialProgressPrivate; +namespace md +{ + +class ProgressBarPrivate; -class QtMaterialProgress : public QProgressBar +class ProgressBar : public QProgressBar { Q_OBJECT @@ -14,8 +17,8 @@ class QtMaterialProgress : public QProgressBar Q_PROPERTY(QColor backgroundColor WRITE setProgressColor READ backgroundColor) public: - explicit QtMaterialProgress(QWidget *parent = 0); - ~QtMaterialProgress(); + explicit ProgressBar(QWidget *parent = 0); + ~ProgressBar(); void setProgressType(Material::ProgressType type); Material::ProgressType progressType() const; @@ -32,11 +35,11 @@ class QtMaterialProgress : public QProgressBar protected: void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QtMaterialProgress) - Q_DECLARE_PRIVATE(QtMaterialProgress) + Q_DISABLE_COPY(ProgressBar) + Q_DECLARE_PRIVATE(ProgressBar) }; - +} #endif // QTMATERIALPROGRESS_H From 5651ee3ed28cf260090272551a6fcb5fcd83b077 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 03:39:07 +0100 Subject: [PATCH 21/46] RadioButton moved to md. --- components/qtmaterialradiobutton.cpp | 26 +++++++++++++++----------- components/qtmaterialradiobutton.h | 16 +++++++++------- components/qtmaterialradiobutton_p.h | 16 +++++++++------- 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/components/qtmaterialradiobutton.cpp b/components/qtmaterialradiobutton.cpp index 86427c787..2eecd8169 100644 --- a/components/qtmaterialradiobutton.cpp +++ b/components/qtmaterialradiobutton.cpp @@ -5,24 +5,27 @@ #include #include #include "lib/qtmaterialcheckable_internal.h" +namespace md +{ + /*! * \class QtMaterialRadioButtonPrivate * \internal */ -QtMaterialRadioButtonPrivate::QtMaterialRadioButtonPrivate(QtMaterialRadioButton *q) - : QtMaterialCheckablePrivate(q) +RadioButtonPrivate::RadioButtonPrivate(RadioButton *q) + : CheckablePrivate(q) { } -QtMaterialRadioButtonPrivate::~QtMaterialRadioButtonPrivate() +RadioButtonPrivate::~RadioButtonPrivate() { } -void QtMaterialRadioButtonPrivate::init() +void RadioButtonPrivate::init() { - Q_Q(QtMaterialRadioButton); + Q_Q(RadioButton); q->setAutoExclusive(true); @@ -78,23 +81,24 @@ void QtMaterialRadioButtonPrivate::init() * \class QtMaterialRadioButton */ -QtMaterialRadioButton::QtMaterialRadioButton(QWidget *parent) - : QtMaterialCheckable(*new QtMaterialRadioButtonPrivate(this), parent) +RadioButton::RadioButton(QWidget *parent) + : Checkable(*new RadioButtonPrivate(this), parent) { d_func()->init(); } -QtMaterialRadioButton::~QtMaterialRadioButton() +RadioButton::~RadioButton() { } -void QtMaterialRadioButton::setupProperties() +void RadioButton::setupProperties() { - QtMaterialCheckable::setupProperties(); + Checkable::setupProperties(); - Q_D(QtMaterialRadioButton); + Q_D(RadioButton); d->checkedState->assignProperty(d->checkedIcon, "color", checkedColor()); d->checkedState->assignProperty(d->uncheckedIcon, "color", uncheckedColor()); d->uncheckedState->assignProperty(d->uncheckedIcon, "color", uncheckedColor()); } +} diff --git a/components/qtmaterialradiobutton.h b/components/qtmaterialradiobutton.h index adc535cc7..4b737ea63 100644 --- a/components/qtmaterialradiobutton.h +++ b/components/qtmaterialradiobutton.h @@ -2,23 +2,25 @@ #define QTMATERIALRADIOBUTTON_H #include "lib/qtmaterialcheckable.h" +namespace md +{ -class QtMaterialRadioButtonPrivate; +class RadioButtonPrivate; -class QtMaterialRadioButton : public QtMaterialCheckable +class RadioButton : public Checkable { Q_OBJECT public: - explicit QtMaterialRadioButton(QWidget *parent = 0); - ~QtMaterialRadioButton(); + explicit RadioButton(QWidget *parent = 0); + ~RadioButton(); protected: void setupProperties(); private: - Q_DISABLE_COPY(QtMaterialRadioButton) - Q_DECLARE_PRIVATE(QtMaterialRadioButton) + Q_DISABLE_COPY(RadioButton) + Q_DECLARE_PRIVATE(RadioButton) }; - +} #endif // QTMATERIALRADIOBUTTON_H diff --git a/components/qtmaterialradiobutton_p.h b/components/qtmaterialradiobutton_p.h index 6bb954aa1..6a25181a8 100644 --- a/components/qtmaterialradiobutton_p.h +++ b/components/qtmaterialradiobutton_p.h @@ -2,19 +2,21 @@ #define QTMATERIALRADIOBUTTON_P_H #include "lib/qtmaterialcheckable_p.h" +namespace md +{ -class QtMaterialRadioButton; +class RadioButton; -class QtMaterialRadioButtonPrivate : public QtMaterialCheckablePrivate +class RadioButtonPrivate : public CheckablePrivate { - Q_DISABLE_COPY(QtMaterialRadioButtonPrivate) - Q_DECLARE_PUBLIC(QtMaterialRadioButton) + Q_DISABLE_COPY(RadioButtonPrivate) + Q_DECLARE_PUBLIC(RadioButton) public: - QtMaterialRadioButtonPrivate(QtMaterialRadioButton *q); - ~QtMaterialRadioButtonPrivate(); + RadioButtonPrivate(RadioButton *q); + ~RadioButtonPrivate(); void init(); }; - +} #endif // QTMATERIALRADIOBUTTON_P_H From b8cb380b32d0f34971367cdf25b30ec0f04a3771 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 03:42:34 +0100 Subject: [PATCH 22/46] RaisedButton moved to md namespace. --- components/qtmaterialraisedbutton.cpp | 33 +++++++++++++++------------ components/qtmaterialraisedbutton.h | 20 ++++++++-------- components/qtmaterialraisedbutton_p.h | 16 +++++++------ 3 files changed, 38 insertions(+), 31 deletions(-) diff --git a/components/qtmaterialraisedbutton.cpp b/components/qtmaterialraisedbutton.cpp index 1607c7072..b7b8ad6a3 100644 --- a/components/qtmaterialraisedbutton.cpp +++ b/components/qtmaterialraisedbutton.cpp @@ -4,6 +4,8 @@ #include #include #include +namespace md +{ /*! * \class QtMaterialRaisedButtonPrivate @@ -13,24 +15,24 @@ /*! * \internal */ -QtMaterialRaisedButtonPrivate::QtMaterialRaisedButtonPrivate(QtMaterialRaisedButton *q) - : QtMaterialFlatButtonPrivate(q) +RaisedButtonPrivate::RaisedButtonPrivate(RaisedButton *q) + : FlatButtonPrivate(q) { } /*! * \internal */ -QtMaterialRaisedButtonPrivate::~QtMaterialRaisedButtonPrivate() +RaisedButtonPrivate::~RaisedButtonPrivate() { } /*! * \internal */ -void QtMaterialRaisedButtonPrivate::init() +void RaisedButtonPrivate::init() { - Q_Q(QtMaterialRaisedButton); + Q_Q(RaisedButton); shadowStateMachine = new QStateMachine(q); normalState = new QState; @@ -87,33 +89,33 @@ void QtMaterialRaisedButtonPrivate::init() * \class QtMaterialRaisedButton */ -QtMaterialRaisedButton::QtMaterialRaisedButton(QWidget *parent) - : QtMaterialFlatButton(*new QtMaterialRaisedButtonPrivate(this), parent) +RaisedButton::RaisedButton(QWidget *parent) + : FlatButton(*new RaisedButtonPrivate(this), parent) { d_func()->init(); } -QtMaterialRaisedButton::QtMaterialRaisedButton(const QString &text, QWidget *parent) - : QtMaterialFlatButton(*new QtMaterialRaisedButtonPrivate(this), parent) +RaisedButton::RaisedButton(const QString &text, QWidget *parent) + : FlatButton(*new RaisedButtonPrivate(this), parent) { d_func()->init(); setText(text); } -QtMaterialRaisedButton::~QtMaterialRaisedButton() +RaisedButton::~RaisedButton() { } -QtMaterialRaisedButton::QtMaterialRaisedButton(QtMaterialRaisedButtonPrivate &d, QWidget *parent) - : QtMaterialFlatButton(d, parent) +RaisedButton::RaisedButton(RaisedButtonPrivate &d, QWidget *parent) + : FlatButton(d, parent) { d_func()->init(); } -bool QtMaterialRaisedButton::event(QEvent *event) +bool RaisedButton::event(QEvent *event) { - Q_D(QtMaterialRaisedButton); + Q_D(RaisedButton); if (QEvent::EnabledChange == event->type()) { if (isEnabled()) { @@ -124,5 +126,6 @@ bool QtMaterialRaisedButton::event(QEvent *event) d->effect->setEnabled(false); } } - return QtMaterialFlatButton::event(event); + return FlatButton::event(event); +} } diff --git a/components/qtmaterialraisedbutton.h b/components/qtmaterialraisedbutton.h index d8b4ef91e..7482a55a6 100644 --- a/components/qtmaterialraisedbutton.h +++ b/components/qtmaterialraisedbutton.h @@ -2,26 +2,28 @@ #define QTMATERIALRAISEDBUTTON_H #include "qtmaterialflatbutton.h" +namespace md +{ -class QtMaterialRaisedButtonPrivate; +class RaisedButtonPrivate; -class QtMaterialRaisedButton : public QtMaterialFlatButton +class RaisedButton : public FlatButton { Q_OBJECT public: - explicit QtMaterialRaisedButton(QWidget *parent = 0); - explicit QtMaterialRaisedButton(const QString &text, QWidget *parent = 0); - ~QtMaterialRaisedButton(); + explicit RaisedButton(QWidget *parent = 0); + explicit RaisedButton(const QString &text, QWidget *parent = 0); + ~RaisedButton(); protected: - QtMaterialRaisedButton(QtMaterialRaisedButtonPrivate &d, QWidget *parent = 0); + RaisedButton(RaisedButtonPrivate &d, QWidget *parent = 0); bool event(QEvent *event) Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(QtMaterialRaisedButton) - Q_DECLARE_PRIVATE(QtMaterialRaisedButton) + Q_DISABLE_COPY(RaisedButton) + Q_DECLARE_PRIVATE(RaisedButton) }; - +} #endif // QTMATERIALRAISEDBUTTON_H diff --git a/components/qtmaterialraisedbutton_p.h b/components/qtmaterialraisedbutton_p.h index 12df43c82..545efe9bb 100644 --- a/components/qtmaterialraisedbutton_p.h +++ b/components/qtmaterialraisedbutton_p.h @@ -2,20 +2,22 @@ #define QTMATERIALRAISEDBUTTON_P_H #include "qtmaterialflatbutton_p.h" +namespace md +{ class QStateMachine; class QState; class QGraphicsDropShadowEffect; -class QtMaterialRaisedButton; +class RaisedButton; -class QtMaterialRaisedButtonPrivate : public QtMaterialFlatButtonPrivate +class RaisedButtonPrivate : public FlatButtonPrivate { - Q_DISABLE_COPY(QtMaterialRaisedButtonPrivate) - Q_DECLARE_PUBLIC(QtMaterialRaisedButton) + Q_DISABLE_COPY(RaisedButtonPrivate) + Q_DECLARE_PUBLIC(RaisedButton) public: - QtMaterialRaisedButtonPrivate(QtMaterialRaisedButton *q); - ~QtMaterialRaisedButtonPrivate(); + RaisedButtonPrivate(RaisedButton *q); + ~RaisedButtonPrivate(); void init(); @@ -24,5 +26,5 @@ class QtMaterialRaisedButtonPrivate : public QtMaterialFlatButtonPrivate QState *pressedState; QGraphicsDropShadowEffect *effect; }; - +} #endif // QTMATERIALRAISEDBUTTON_P_H From ef1427c9f349afc4d1ebbf34a94ce71387ab58a3 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 03:46:48 +0100 Subject: [PATCH 23/46] ScrollBar moved --- components/qtmaterialscrollbar.cpp | 71 +++++++++++---------- components/qtmaterialscrollbar.h | 18 +++--- components/qtmaterialscrollbar_internal.cpp | 7 +- components/qtmaterialscrollbar_internal.h | 18 +++--- components/qtmaterialscrollbar_p.h | 22 ++++--- 5 files changed, 74 insertions(+), 62 deletions(-) diff --git a/components/qtmaterialscrollbar.cpp b/components/qtmaterialscrollbar.cpp index bb44820f9..b0986539a 100644 --- a/components/qtmaterialscrollbar.cpp +++ b/components/qtmaterialscrollbar.cpp @@ -5,31 +5,33 @@ #include #include "qtmaterialscrollbar_internal.h" #include "lib/qtmaterialstyle.h" +namespace md +{ /*! * \class QtMaterialScrollBarPrivate * \internal */ -QtMaterialScrollBarPrivate::QtMaterialScrollBarPrivate(QtMaterialScrollBar *q) +ScrollBarPrivate::ScrollBarPrivate(ScrollBar *q) : q_ptr(q) { } -QtMaterialScrollBarPrivate::~QtMaterialScrollBarPrivate() +ScrollBarPrivate::~ScrollBarPrivate() { } -void QtMaterialScrollBarPrivate::init() +void ScrollBarPrivate::init() { - Q_Q(QtMaterialScrollBar); + Q_Q(ScrollBar); - stateMachine = new QtMaterialScrollBarStateMachine(q); + stateMachine = new ScrollBarStateMachine(q); hideOnMouseOut = true; useThemeColors = true; q->setMouseTracking(true); - q->setStyle(&QtMaterialStyle::instance()); + q->setStyle(&Style::instance()); q->setStyleSheet("QScrollBar:vertical { margin: 0; }" "QScrollBar::add-line:vertical { height: 0; margin: 0; }" "QScrollBar::sub-line:vertical { height: 0; margin: 0; }"); @@ -41,21 +43,21 @@ void QtMaterialScrollBarPrivate::init() * \class QtMaterialScrollBar */ -QtMaterialScrollBar::QtMaterialScrollBar(QWidget *parent) +ScrollBar::ScrollBar(QWidget *parent) : QScrollBar(parent), - d_ptr(new QtMaterialScrollBarPrivate(this)) + d_ptr(new ScrollBarPrivate(this)) { d_func()->init(); } -QtMaterialScrollBar::~QtMaterialScrollBar() +ScrollBar::~ScrollBar() { } /*! * \reimp */ -QSize QtMaterialScrollBar::sizeHint() const +QSize ScrollBar::sizeHint() const { if (Qt::Horizontal == orientation()) { return QSize(1, 10); @@ -64,9 +66,9 @@ QSize QtMaterialScrollBar::sizeHint() const } } -void QtMaterialScrollBar::setUseThemeColors(bool value) +void ScrollBar::setUseThemeColors(bool value) { - Q_D(QtMaterialScrollBar); + Q_D(ScrollBar); if (d->useThemeColors == value) { return; @@ -76,16 +78,16 @@ void QtMaterialScrollBar::setUseThemeColors(bool value) update(); } -bool QtMaterialScrollBar::useThemeColors() const +bool ScrollBar::useThemeColors() const { - Q_D(const QtMaterialScrollBar); + Q_D(const ScrollBar); return d->useThemeColors; } -void QtMaterialScrollBar::setCanvasColor(const QColor &color) +void ScrollBar::setCanvasColor(const QColor &color) { - Q_D(QtMaterialScrollBar); + Q_D(ScrollBar); d->canvasColor = color; @@ -93,9 +95,9 @@ void QtMaterialScrollBar::setCanvasColor(const QColor &color) update(); } -QColor QtMaterialScrollBar::canvasColor() const +QColor ScrollBar::canvasColor() const { - Q_D(const QtMaterialScrollBar); + Q_D(const ScrollBar); if (d->useThemeColors || !d->canvasColor.isValid()) { return parentWidget()->palette().color(backgroundRole()); @@ -104,9 +106,9 @@ QColor QtMaterialScrollBar::canvasColor() const } } -void QtMaterialScrollBar::setBackgroundColor(const QColor &color) +void ScrollBar::setBackgroundColor(const QColor &color) { - Q_D(QtMaterialScrollBar); + Q_D(ScrollBar); d->backgroundColor = color; @@ -114,20 +116,20 @@ void QtMaterialScrollBar::setBackgroundColor(const QColor &color) update(); } -QColor QtMaterialScrollBar::backgroundColor() const +QColor ScrollBar::backgroundColor() const { - Q_D(const QtMaterialScrollBar); + Q_D(const ScrollBar); if (d->useThemeColors || !d->backgroundColor.isValid()) { - return QtMaterialStyle::instance().themeColor("border"); + return Style::instance().themeColor("border"); } else { return d->backgroundColor; } } -void QtMaterialScrollBar::setSliderColor(const QColor &color) +void ScrollBar::setSliderColor(const QColor &color) { - Q_D(QtMaterialScrollBar); + Q_D(ScrollBar); d->sliderColor = color; @@ -135,28 +137,28 @@ void QtMaterialScrollBar::setSliderColor(const QColor &color) update(); } -QColor QtMaterialScrollBar::sliderColor() const +QColor ScrollBar::sliderColor() const { - Q_D(const QtMaterialScrollBar); + Q_D(const ScrollBar); if (d->useThemeColors || !d->sliderColor.isValid()) { - return QtMaterialStyle::instance().themeColor("primary1"); + return Style::instance().themeColor("primary1"); } else { return d->sliderColor; } } -void QtMaterialScrollBar::setHideOnMouseOut(bool value) +void ScrollBar::setHideOnMouseOut(bool value) { - Q_D(QtMaterialScrollBar); + Q_D(ScrollBar); d->hideOnMouseOut = value; update(); } -bool QtMaterialScrollBar::hideOnMouseOut() const +bool ScrollBar::hideOnMouseOut() const { - Q_D(const QtMaterialScrollBar); + Q_D(const ScrollBar); return d->hideOnMouseOut; } @@ -164,11 +166,11 @@ bool QtMaterialScrollBar::hideOnMouseOut() const /*! * \reimp */ -void QtMaterialScrollBar::paintEvent(QPaintEvent *event) +void ScrollBar::paintEvent(QPaintEvent *event) { Q_UNUSED(event) - Q_D(QtMaterialScrollBar); + Q_D(ScrollBar); QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); @@ -210,3 +212,4 @@ void QtMaterialScrollBar::paintEvent(QPaintEvent *event) painter.drawRoundedRect(handle, 9, 9); } +} diff --git a/components/qtmaterialscrollbar.h b/components/qtmaterialscrollbar.h index 591c9f171..aef78dc16 100644 --- a/components/qtmaterialscrollbar.h +++ b/components/qtmaterialscrollbar.h @@ -2,10 +2,12 @@ #define QTMATERIALSCROLLBAR_H #include +namespace md +{ -class QtMaterialScrollBarPrivate; +class ScrollBarPrivate; -class QtMaterialScrollBar : public QScrollBar +class ScrollBar : public QScrollBar { Q_OBJECT @@ -14,8 +16,8 @@ class QtMaterialScrollBar : public QScrollBar Q_PROPERTY(QColor sliderColor WRITE setSliderColor READ sliderColor) public: - explicit QtMaterialScrollBar(QWidget *parent = 0); - ~QtMaterialScrollBar(); + explicit ScrollBar(QWidget *parent = 0); + ~ScrollBar(); QSize sizeHint() const Q_DECL_OVERRIDE; @@ -37,11 +39,11 @@ class QtMaterialScrollBar : public QScrollBar protected: void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QtMaterialScrollBar) - Q_DECLARE_PRIVATE(QtMaterialScrollBar) + Q_DISABLE_COPY(ScrollBar) + Q_DECLARE_PRIVATE(ScrollBar) }; - +} #endif // QTMATERIALSCROLLBAR_H diff --git a/components/qtmaterialscrollbar_internal.cpp b/components/qtmaterialscrollbar_internal.cpp index 248d91ad8..2317f4549 100644 --- a/components/qtmaterialscrollbar_internal.cpp +++ b/components/qtmaterialscrollbar_internal.cpp @@ -1,6 +1,8 @@ #include "qtmaterialscrollbar_internal.h" #include #include +namespace md +{ /*! * \class QtMaterialScrollBarStateMachine @@ -10,7 +12,7 @@ /*! * \internal */ -QtMaterialScrollBarStateMachine::QtMaterialScrollBarStateMachine(QtMaterialScrollBar *parent) +ScrollBarStateMachine::ScrollBarStateMachine(ScrollBar *parent) : QStateMachine(parent), m_scrollBar(parent), m_focusState(new QState), @@ -46,6 +48,7 @@ QtMaterialScrollBarStateMachine::QtMaterialScrollBarStateMachine(QtMaterialScrol /*! * \internal */ -QtMaterialScrollBarStateMachine::~QtMaterialScrollBarStateMachine() +ScrollBarStateMachine::~ScrollBarStateMachine() { } +} diff --git a/components/qtmaterialscrollbar_internal.h b/components/qtmaterialscrollbar_internal.h index 7b1cc92ac..d05412007 100644 --- a/components/qtmaterialscrollbar_internal.h +++ b/components/qtmaterialscrollbar_internal.h @@ -3,38 +3,40 @@ #include #include "qtmaterialscrollbar.h" +namespace md +{ -class QtMaterialScrollBarStateMachine : public QStateMachine +class ScrollBarStateMachine : public QStateMachine { Q_OBJECT Q_PROPERTY(qreal opacity WRITE setOpacity READ opacity) public: - QtMaterialScrollBarStateMachine(QtMaterialScrollBar *parent); - ~QtMaterialScrollBarStateMachine(); + ScrollBarStateMachine(ScrollBar *parent); + ~ScrollBarStateMachine(); inline void setOpacity(qreal opacity); inline qreal opacity() const; private: - Q_DISABLE_COPY(QtMaterialScrollBarStateMachine) + Q_DISABLE_COPY(ScrollBarStateMachine) - QtMaterialScrollBar *const m_scrollBar; + ScrollBar *const m_scrollBar; QState *const m_focusState; QState *const m_blurState; qreal m_opacity; }; -inline void QtMaterialScrollBarStateMachine::setOpacity(qreal opacity) +inline void ScrollBarStateMachine::setOpacity(qreal opacity) { m_opacity = opacity; m_scrollBar->update(); } -inline qreal QtMaterialScrollBarStateMachine::opacity() const +inline qreal ScrollBarStateMachine::opacity() const { return m_opacity; } - +} #endif // QTMATERIALSCROLLBAR_INTERNAL_H diff --git a/components/qtmaterialscrollbar_p.h b/components/qtmaterialscrollbar_p.h index 1d22cc06b..2d73e733d 100644 --- a/components/qtmaterialscrollbar_p.h +++ b/components/qtmaterialscrollbar_p.h @@ -3,28 +3,30 @@ #include #include +namespace md +{ -class QtMaterialScrollBar; -class QtMaterialScrollBarStateMachine; +class ScrollBar; +class ScrollBarStateMachine; -class QtMaterialScrollBarPrivate +class ScrollBarPrivate { - Q_DISABLE_COPY(QtMaterialScrollBarPrivate) - Q_DECLARE_PUBLIC(QtMaterialScrollBar) + Q_DISABLE_COPY(ScrollBarPrivate) + Q_DECLARE_PUBLIC(ScrollBar) public: - QtMaterialScrollBarPrivate(QtMaterialScrollBar *q); - ~QtMaterialScrollBarPrivate(); + ScrollBarPrivate(ScrollBar *q); + ~ScrollBarPrivate(); void init(); - QtMaterialScrollBar *const q_ptr; - QtMaterialScrollBarStateMachine *stateMachine; + ScrollBar *const q_ptr; + ScrollBarStateMachine *stateMachine; QColor backgroundColor; QColor sliderColor; QColor canvasColor; bool hideOnMouseOut; bool useThemeColors; }; - +} #endif // QTMATERIALSCROLLBAR_P_H From 098267afee81831cb9a960b44b595c23cb79713b Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 03:51:42 +0100 Subject: [PATCH 24/46] Slider moved --- components/qtmaterialslider.cpp | 125 ++++++++++++----------- components/qtmaterialslider.h | 18 ++-- components/qtmaterialslider_internal.cpp | 49 ++++----- components/qtmaterialslider_internal.h | 86 ++++++++-------- components/qtmaterialslider_p.h | 30 +++--- 5 files changed, 160 insertions(+), 148 deletions(-) diff --git a/components/qtmaterialslider.cpp b/components/qtmaterialslider.cpp index a0d17dc12..e7eccb7e5 100644 --- a/components/qtmaterialslider.cpp +++ b/components/qtmaterialslider.cpp @@ -5,28 +5,30 @@ #include "qtmaterialslider_internal.h" #include "lib/qtmaterialstyle.h" #include "lib/qtmaterialstatetransitionevent.h" +namespace md +{ /*! * \class QtMaterialSliderPrivate * \internal */ -QtMaterialSliderPrivate::QtMaterialSliderPrivate(QtMaterialSlider *q) +SliderPrivate::SliderPrivate(Slider *q) : q_ptr(q) { } -QtMaterialSliderPrivate::~QtMaterialSliderPrivate() +SliderPrivate::~SliderPrivate() { } -void QtMaterialSliderPrivate::init() +void SliderPrivate::init() { - Q_Q(QtMaterialSlider); + Q_Q(Slider); - thumb = new QtMaterialSliderThumb(q); - track = new QtMaterialSliderTrack(thumb, q); - stateMachine = new QtMaterialSliderStateMachine(q, thumb, track); + thumb = new SliderThumb(q); + track = new SliderTrack(thumb, q); + stateMachine = new SliderStateMachine(q, thumb, track); stepTo = 0; oldValue = q->value(); trackWidth = 2; @@ -55,9 +57,9 @@ void QtMaterialSliderPrivate::init() QCoreApplication::processEvents(); } -QRectF QtMaterialSliderPrivate::trackBoundingRect() const +QRectF SliderPrivate::trackBoundingRect() const { - Q_Q(const QtMaterialSlider); + Q_Q(const Slider); qreal hw = static_cast(trackWidth)/2; @@ -68,9 +70,9 @@ QRectF QtMaterialSliderPrivate::trackBoundingRect() const q->height() - QT_MATERIAL_SLIDER_MARGIN*2); } -QRectF QtMaterialSliderPrivate::thumbBoundingRect() const +QRectF SliderPrivate::thumbBoundingRect() const { - Q_Q(const QtMaterialSlider); + Q_Q(const Slider); return Qt::Horizontal == q->orientation() ? QRectF(thumb->offset(), q->height()/2 - QT_MATERIAL_SLIDER_MARGIN, @@ -79,9 +81,9 @@ QRectF QtMaterialSliderPrivate::thumbBoundingRect() const QT_MATERIAL_SLIDER_MARGIN*2, QT_MATERIAL_SLIDER_MARGIN*2); } -int QtMaterialSliderPrivate::valueFromPosition(const QPoint &pos) const +int SliderPrivate::valueFromPosition(const QPoint &pos) const { - Q_Q(const QtMaterialSlider); + Q_Q(const Slider); const int position = Qt::Horizontal == q->orientation() ? pos.x() : pos.y(); @@ -89,7 +91,7 @@ int QtMaterialSliderPrivate::valueFromPosition(const QPoint &pos) const ? q->width() - QT_MATERIAL_SLIDER_MARGIN*2 : q->height() - QT_MATERIAL_SLIDER_MARGIN*2; - return QtMaterialStyle::sliderValueFromPosition( + return Style::sliderValueFromPosition( q->minimum(), q->maximum(), position - QT_MATERIAL_SLIDER_MARGIN, @@ -97,9 +99,9 @@ int QtMaterialSliderPrivate::valueFromPosition(const QPoint &pos) const q->invertedAppearance()); } -void QtMaterialSliderPrivate::setHovered(bool status) +void SliderPrivate::setHovered(bool status) { - Q_Q(QtMaterialSlider); + Q_Q(Slider); if (hover == status) { return; @@ -109,9 +111,9 @@ void QtMaterialSliderPrivate::setHovered(bool status) if (!q->hasFocus()) { if (status) { - stateMachine->postEvent(new QtMaterialStateTransitionEvent(SliderNoFocusMouseEnter)); + stateMachine->postEvent(new StateTransitionEvent(SliderNoFocusMouseEnter)); } else { - stateMachine->postEvent(new QtMaterialStateTransitionEvent(SliderNoFocusMouseLeave)); + stateMachine->postEvent(new StateTransitionEvent(SliderNoFocusMouseLeave)); } } @@ -122,20 +124,20 @@ void QtMaterialSliderPrivate::setHovered(bool status) * \class QtMaterialSlider */ -QtMaterialSlider::QtMaterialSlider(QWidget *parent) +Slider::Slider(QWidget *parent) : QAbstractSlider(parent), - d_ptr(new QtMaterialSliderPrivate(this)) + d_ptr(new SliderPrivate(this)) { d_func()->init(); } -QtMaterialSlider::~QtMaterialSlider() +Slider::~Slider() { } -void QtMaterialSlider::setUseThemeColors(bool value) +void Slider::setUseThemeColors(bool value) { - Q_D(QtMaterialSlider); + Q_D(Slider); if (d->useThemeColors == value) { return; @@ -145,16 +147,16 @@ void QtMaterialSlider::setUseThemeColors(bool value) d->stateMachine->setupProperties(); } -bool QtMaterialSlider::useThemeColors() const +bool Slider::useThemeColors() const { - Q_D(const QtMaterialSlider); + Q_D(const Slider); return d->useThemeColors; } -void QtMaterialSlider::setThumbColor(const QColor &color) +void Slider::setThumbColor(const QColor &color) { - Q_D(QtMaterialSlider); + Q_D(Slider); d->thumbColor = color; @@ -163,20 +165,20 @@ void QtMaterialSlider::setThumbColor(const QColor &color) update(); } -QColor QtMaterialSlider::thumbColor() const +QColor Slider::thumbColor() const { - Q_D(const QtMaterialSlider); + Q_D(const Slider); if (d->useThemeColors || !d->thumbColor.isValid()) { - return QtMaterialStyle::instance().themeColor("primary1"); + return Style::instance().themeColor("primary1"); } else { return d->thumbColor; } } -void QtMaterialSlider::setTrackColor(const QColor &color) +void Slider::setTrackColor(const QColor &color) { - Q_D(QtMaterialSlider); + Q_D(Slider); d->trackColor = color; @@ -185,20 +187,20 @@ void QtMaterialSlider::setTrackColor(const QColor &color) update(); } -QColor QtMaterialSlider::trackColor() const +QColor Slider::trackColor() const { - Q_D(const QtMaterialSlider); + Q_D(const Slider); if (d->useThemeColors || !d->trackColor.isValid()) { - return QtMaterialStyle::instance().themeColor("accent3"); + return Style::instance().themeColor("accent3"); } else { return d->trackColor; } } -void QtMaterialSlider::setDisabledColor(const QColor &color) +void Slider::setDisabledColor(const QColor &color) { - Q_D(QtMaterialSlider); + Q_D(Slider); d->disabledColor = color; @@ -207,27 +209,27 @@ void QtMaterialSlider::setDisabledColor(const QColor &color) update(); } -QColor QtMaterialSlider::disabledColor() const +QColor Slider::disabledColor() const { - Q_D(const QtMaterialSlider); + Q_D(const Slider); if (d->useThemeColors || !d->disabledColor.isValid()) { - return QtMaterialStyle::instance().themeColor("disabled"); + return Style::instance().themeColor("disabled"); } else { return d->disabledColor; } } -void QtMaterialSlider::setPageStepMode(bool pageStep) +void Slider::setPageStepMode(bool pageStep) { - Q_D(QtMaterialSlider); + Q_D(Slider); d->pageStepMode = pageStep; } -bool QtMaterialSlider::pageStepMode() const +bool Slider::pageStepMode() const { - Q_D(const QtMaterialSlider); + Q_D(const Slider); return d->pageStepMode; } @@ -235,14 +237,14 @@ bool QtMaterialSlider::pageStepMode() const /*! * \remip */ -QSize QtMaterialSlider::minimumSizeHint() const +QSize Slider::minimumSizeHint() const { return Qt::Horizontal == orientation() ? QSize(130, 34) : QSize(34, 130); } -void QtMaterialSlider::setInvertedAppearance(bool value) +void Slider::setInvertedAppearance(bool value) { QAbstractSlider::setInvertedAppearance(value); @@ -252,9 +254,9 @@ void QtMaterialSlider::setInvertedAppearance(bool value) /*! * \remip */ -void QtMaterialSlider::sliderChange(SliderChange change) +void Slider::sliderChange(SliderChange change) { - Q_D(QtMaterialSlider); + Q_D(Slider); if (SliderOrientationChange == change) { @@ -268,12 +270,12 @@ void QtMaterialSlider::sliderChange(SliderChange change) { if (minimum() == value()) { triggerAction(SliderToMinimum); - d->stateMachine->postEvent(new QtMaterialStateTransitionEvent(SliderChangedToMinimum)); + d->stateMachine->postEvent(new StateTransitionEvent(SliderChangedToMinimum)); } else if (maximum() == value()) { triggerAction(SliderToMaximum); } if (minimum() == d->oldValue) { - d->stateMachine->postEvent(new QtMaterialStateTransitionEvent(SliderChangedFromMinimum)); + d->stateMachine->postEvent(new StateTransitionEvent(SliderChangedFromMinimum)); } d->oldValue = value(); } @@ -286,9 +288,9 @@ void QtMaterialSlider::sliderChange(SliderChange change) /*! * \remip */ -void QtMaterialSlider::mouseMoveEvent(QMouseEvent *event) +void Slider::mouseMoveEvent(QMouseEvent *event) { - Q_D(QtMaterialSlider); + Q_D(Slider); if (isSliderDown()) { @@ -320,9 +322,9 @@ void QtMaterialSlider::mouseMoveEvent(QMouseEvent *event) /*! * \remip */ -void QtMaterialSlider::mousePressEvent(QMouseEvent *event) +void Slider::mousePressEvent(QMouseEvent *event) { - Q_D(QtMaterialSlider); + Q_D(Slider); const QPoint pos = event->pos(); @@ -355,9 +357,9 @@ void QtMaterialSlider::mousePressEvent(QMouseEvent *event) /*! * \remip */ -void QtMaterialSlider::mouseReleaseEvent(QMouseEvent *event) +void Slider::mouseReleaseEvent(QMouseEvent *event) { - Q_D(QtMaterialSlider); + Q_D(Slider); if (isSliderDown()) { setSliderDown(false); @@ -372,9 +374,9 @@ void QtMaterialSlider::mouseReleaseEvent(QMouseEvent *event) /*! * \remip */ -void QtMaterialSlider::leaveEvent(QEvent *event) +void Slider::leaveEvent(QEvent *event) { - Q_D(QtMaterialSlider); + Q_D(Slider); if (d->hoverTrack) { d->hoverTrack = false; @@ -390,11 +392,11 @@ void QtMaterialSlider::leaveEvent(QEvent *event) QAbstractSlider::leaveEvent(event); } -void QtMaterialSlider::updateThumbOffset() +void Slider::updateThumbOffset() { - Q_D(QtMaterialSlider); + Q_D(Slider); - const int offset = QtMaterialStyle::sliderPositionFromValue( + const int offset = Style::sliderPositionFromValue( minimum(), maximum(), sliderPosition(), @@ -405,3 +407,4 @@ void QtMaterialSlider::updateThumbOffset() d->thumb->setOffset(offset); } +} diff --git a/components/qtmaterialslider.h b/components/qtmaterialslider.h index f8e642d8c..c13c03aa4 100644 --- a/components/qtmaterialslider.h +++ b/components/qtmaterialslider.h @@ -5,10 +5,12 @@ #include #define QT_MATERIAL_SLIDER_MARGIN 30 +namespace md +{ -class QtMaterialSliderPrivate; +class SliderPrivate; -class QtMaterialSlider : public QAbstractSlider +class Slider : public QAbstractSlider { Q_OBJECT @@ -17,8 +19,8 @@ class QtMaterialSlider : public QAbstractSlider Q_PROPERTY(QColor disabledColor WRITE setDisabledColor READ disabledColor) public: - explicit QtMaterialSlider(QWidget *parent = 0); - ~QtMaterialSlider(); + explicit Slider(QWidget *parent = 0); + ~Slider(); void setUseThemeColors(bool value); bool useThemeColors() const; @@ -48,11 +50,11 @@ class QtMaterialSlider : public QAbstractSlider void updateThumbOffset(); - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QtMaterialSlider) - Q_DECLARE_PRIVATE(QtMaterialSlider) + Q_DISABLE_COPY(Slider) + Q_DECLARE_PRIVATE(Slider) }; - +} #endif // QTMATERIALSLIDER_H diff --git a/components/qtmaterialslider_internal.cpp b/components/qtmaterialslider_internal.cpp index fd2d50bf8..c3a96d761 100644 --- a/components/qtmaterialslider_internal.cpp +++ b/components/qtmaterialslider_internal.cpp @@ -8,16 +8,18 @@ #include "qtmaterialslider.h" #include "lib/qtmaterialstyle.h" #include "lib/qtmaterialstatetransition.h" +namespace md +{ /*! * \class QtMaterialSliderStateMachine * \internal */ -QtMaterialSliderStateMachine::QtMaterialSliderStateMachine( - QtMaterialSlider *slider, - QtMaterialSliderThumb *thumb, - QtMaterialSliderTrack *track) +SliderStateMachine::SliderStateMachine( + Slider *slider, + SliderThumb *thumb, + SliderTrack *track) : QStateMachine(slider), m_slider(slider), m_thumb(thumb), @@ -50,12 +52,12 @@ QtMaterialSliderStateMachine::QtMaterialSliderStateMachine( m_slidingState->assignProperty(thumb, "diameter", 17); QAbstractTransition *transition; - QtMaterialStateTransition *customTransition; + StateTransition *customTransition; QPropertyAnimation *animation; // Show halo on mouse enter - customTransition = new QtMaterialStateTransition(SliderNoFocusMouseEnter); + customTransition = new StateTransition(SliderNoFocusMouseEnter); customTransition->setTargetState(m_focusState); animation = new QPropertyAnimation(thumb, "haloSize", this); @@ -88,7 +90,7 @@ QtMaterialSliderStateMachine::QtMaterialSliderStateMachine( // Hide halo on mouse leave, except if widget has focus - customTransition = new QtMaterialStateTransition(SliderNoFocusMouseLeave); + customTransition = new StateTransition(SliderNoFocusMouseLeave); customTransition->setTargetState(m_inactiveState); animation = new QPropertyAnimation(thumb, "haloSize", this); @@ -152,7 +154,7 @@ QtMaterialSliderStateMachine::QtMaterialSliderStateMachine( m_sndState->setInitialState(m_minState); - customTransition = new QtMaterialStateTransition(SliderChangedFromMinimum); + customTransition = new StateTransition(SliderChangedFromMinimum); customTransition->setTargetState(m_normalState); animation = new QPropertyAnimation(thumb, "fillColor", this); @@ -173,7 +175,7 @@ QtMaterialSliderStateMachine::QtMaterialSliderStateMachine( m_minState->addTransition(customTransition); - customTransition = new QtMaterialStateTransition(SliderChangedToMinimum); + customTransition = new StateTransition(SliderChangedToMinimum); customTransition->setTargetState(m_minState); animation = new QPropertyAnimation(thumb, "fillColor", this); @@ -197,11 +199,11 @@ QtMaterialSliderStateMachine::QtMaterialSliderStateMachine( setupProperties(); } -QtMaterialSliderStateMachine::~QtMaterialSliderStateMachine() +SliderStateMachine::~SliderStateMachine() { } -void QtMaterialSliderStateMachine::setupProperties() +void SliderStateMachine::setupProperties() { QColor trackColor = m_slider->trackColor(); QColor thumbColor = m_slider->thumbColor(); @@ -233,8 +235,8 @@ void QtMaterialSliderStateMachine::setupProperties() * \internal */ -QtMaterialSliderThumb::QtMaterialSliderThumb(QtMaterialSlider *slider) - : QtMaterialOverlayWidget(slider->parentWidget()), +SliderThumb::SliderThumb(Slider *slider) + : OverlayWidget(slider->parentWidget()), m_slider(slider), m_diameter(11), m_borderWidth(2), @@ -246,20 +248,20 @@ QtMaterialSliderThumb::QtMaterialSliderThumb(QtMaterialSlider *slider) setAttribute(Qt::WA_TransparentForMouseEvents, true); } -QtMaterialSliderThumb::~QtMaterialSliderThumb() +SliderThumb::~SliderThumb() { } -bool QtMaterialSliderThumb::eventFilter(QObject *obj, QEvent *event) +bool SliderThumb::eventFilter(QObject *obj, QEvent *event) { if (QEvent::ParentChange == event->type()) { setParent(m_slider->parentWidget()); } - return QtMaterialOverlayWidget::eventFilter(obj, event); + return OverlayWidget::eventFilter(obj, event); } -void QtMaterialSliderThumb::paintEvent(QPaintEvent *event) +void SliderThumb::paintEvent(QPaintEvent *event) { Q_UNUSED(event) @@ -325,8 +327,8 @@ void QtMaterialSliderThumb::paintEvent(QPaintEvent *event) * \internal */ -QtMaterialSliderTrack::QtMaterialSliderTrack(QtMaterialSliderThumb *thumb, QtMaterialSlider *slider) - : QtMaterialOverlayWidget(slider->parentWidget()), +SliderTrack::SliderTrack(SliderThumb *thumb, Slider *slider) + : OverlayWidget(slider->parentWidget()), m_slider(slider), m_thumb(thumb), m_trackWidth(2) @@ -338,20 +340,20 @@ QtMaterialSliderTrack::QtMaterialSliderTrack(QtMaterialSliderThumb *thumb, QtMat connect(slider, SIGNAL(sliderMoved(int)), this, SLOT(update())); } -QtMaterialSliderTrack::~QtMaterialSliderTrack() +SliderTrack::~SliderTrack() { } -bool QtMaterialSliderTrack::eventFilter(QObject *obj, QEvent *event) +bool SliderTrack::eventFilter(QObject *obj, QEvent *event) { if (QEvent::ParentChange == event->type()) { setParent(m_slider->parentWidget()); } - return QtMaterialOverlayWidget::eventFilter(obj, event); + return OverlayWidget::eventFilter(obj, event); } -void QtMaterialSliderTrack::paintEvent(QPaintEvent *event) +void SliderTrack::paintEvent(QPaintEvent *event) { Q_UNUSED(event) @@ -406,3 +408,4 @@ void QtMaterialSliderTrack::paintEvent(QPaintEvent *event) painter.fillRect(bgRect, bg); painter.fillRect(fgRect, fg); } +} diff --git a/components/qtmaterialslider_internal.h b/components/qtmaterialslider_internal.h index 6f2649e8e..756a03f2f 100644 --- a/components/qtmaterialslider_internal.h +++ b/components/qtmaterialslider_internal.h @@ -3,29 +3,31 @@ #include #include "lib/qtmaterialoverlaywidget.h" +namespace md +{ -class QtMaterialSlider; -class QtMaterialSliderThumb; -class QtMaterialSliderTrack; +class Slider; +class SliderThumb; +class SliderTrack; -class QtMaterialSliderStateMachine : public QStateMachine +class SliderStateMachine : public QStateMachine { Q_OBJECT public: - QtMaterialSliderStateMachine(QtMaterialSlider *slider, - QtMaterialSliderThumb *thumb, - QtMaterialSliderTrack *track); - ~QtMaterialSliderStateMachine(); + SliderStateMachine(Slider *slider, + SliderThumb *thumb, + SliderTrack *track); + ~SliderStateMachine(); void setupProperties(); private: - Q_DISABLE_COPY(QtMaterialSliderStateMachine) + Q_DISABLE_COPY(SliderStateMachine) - QtMaterialSlider *const m_slider; - QtMaterialSliderThumb *const m_thumb; - QtMaterialSliderTrack *const m_track; + Slider *const m_slider; + SliderThumb *const m_thumb; + SliderTrack *const m_track; QState *const m_topState; QState *const m_fstState; QState *const m_sndState; @@ -38,7 +40,7 @@ class QtMaterialSliderStateMachine : public QStateMachine QState *const m_normalState; }; -class QtMaterialSliderThumb : public QtMaterialOverlayWidget +class SliderThumb : public OverlayWidget { Q_OBJECT @@ -50,8 +52,8 @@ class QtMaterialSliderThumb : public QtMaterialOverlayWidget Q_PROPERTY(QColor haloColor WRITE setHaloColor READ haloColor) public: - explicit QtMaterialSliderThumb(QtMaterialSlider *slider); - ~QtMaterialSliderThumb(); + explicit SliderThumb(Slider *slider); + ~SliderThumb(); inline void setDiameter(qreal diameter); inline qreal diameter() const; @@ -79,9 +81,9 @@ class QtMaterialSliderThumb : public QtMaterialOverlayWidget void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(QtMaterialSliderThumb) + Q_DISABLE_COPY(SliderThumb) - const QtMaterialSlider *const m_slider; + const Slider *const m_slider; QColor m_borderColor; QColor m_fillColor; QColor m_haloColor; @@ -91,92 +93,92 @@ class QtMaterialSliderThumb : public QtMaterialOverlayWidget int m_offset; }; -inline void QtMaterialSliderThumb::setDiameter(qreal diameter) +inline void SliderThumb::setDiameter(qreal diameter) { m_diameter = diameter; update(); } -inline qreal QtMaterialSliderThumb::diameter() const +inline qreal SliderThumb::diameter() const { return m_diameter; } -inline void QtMaterialSliderThumb::setBorderWidth(qreal width) +inline void SliderThumb::setBorderWidth(qreal width) { m_borderWidth = width; update(); } -inline qreal QtMaterialSliderThumb::borderWidth() const +inline qreal SliderThumb::borderWidth() const { return m_borderWidth; } -inline void QtMaterialSliderThumb::setBorderColor(const QColor &color) +inline void SliderThumb::setBorderColor(const QColor &color) { m_borderColor = color; update(); } -inline QColor QtMaterialSliderThumb::borderColor() const +inline QColor SliderThumb::borderColor() const { return m_borderColor; } -inline void QtMaterialSliderThumb::setFillColor(const QColor &color) +inline void SliderThumb::setFillColor(const QColor &color) { m_fillColor = color; update(); } -inline QColor QtMaterialSliderThumb::fillColor() const +inline QColor SliderThumb::fillColor() const { return m_fillColor; } -inline void QtMaterialSliderThumb::setHaloSize(qreal size) +inline void SliderThumb::setHaloSize(qreal size) { m_haloSize = size; update(); } -inline qreal QtMaterialSliderThumb::haloSize() const +inline qreal SliderThumb::haloSize() const { return m_haloSize; } -inline void QtMaterialSliderThumb::setHaloColor(const QColor &color) +inline void SliderThumb::setHaloColor(const QColor &color) { m_haloColor = color; update(); } -inline QColor QtMaterialSliderThumb::haloColor() const +inline QColor SliderThumb::haloColor() const { return m_haloColor; } -inline void QtMaterialSliderThumb::setOffset(int offset) +inline void SliderThumb::setOffset(int offset) { m_offset = offset; update(); } -inline int QtMaterialSliderThumb::offset() const +inline int SliderThumb::offset() const { return m_offset; } -class QtMaterialSliderTrack : public QtMaterialOverlayWidget +class SliderTrack : public OverlayWidget { Q_OBJECT Q_PROPERTY(QColor fillColor WRITE setFillColor READ fillColor) public: - explicit QtMaterialSliderTrack(QtMaterialSliderThumb *thumb, QtMaterialSlider *slider); - ~QtMaterialSliderTrack(); + explicit SliderTrack(SliderThumb *thumb, Slider *slider); + ~SliderTrack(); inline void setFillColor(const QColor &color); inline QColor fillColor() const; @@ -189,34 +191,34 @@ class QtMaterialSliderTrack : public QtMaterialOverlayWidget void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(QtMaterialSliderTrack) + Q_DISABLE_COPY(SliderTrack) - const QtMaterialSlider *const m_slider; - QtMaterialSliderThumb *const m_thumb; + const Slider *const m_slider; + SliderThumb *const m_thumb; QColor m_fillColor; int m_trackWidth; }; -inline void QtMaterialSliderTrack::setFillColor(const QColor &color) +inline void SliderTrack::setFillColor(const QColor &color) { m_fillColor = color; update(); } -inline QColor QtMaterialSliderTrack::fillColor() const +inline QColor SliderTrack::fillColor() const { return m_fillColor; } -void QtMaterialSliderTrack::setTrackWidth(int width) +void SliderTrack::setTrackWidth(int width) { m_trackWidth = width; update(); } -int QtMaterialSliderTrack::trackWidth() const +int SliderTrack::trackWidth() const { return m_trackWidth; } - +} #endif // QTMATERIALSLIDER_INTERNAL_H diff --git a/components/qtmaterialslider_p.h b/components/qtmaterialslider_p.h index ff6b7ca2b..d36191d6e 100644 --- a/components/qtmaterialslider_p.h +++ b/components/qtmaterialslider_p.h @@ -4,20 +4,22 @@ #include #include #include +namespace md +{ -class QtMaterialSlider; -class QtMaterialSliderThumb; -class QtMaterialSliderTrack; -class QtMaterialSliderStateMachine; +class Slider; +class SliderThumb; +class SliderTrack; +class SliderStateMachine; -class QtMaterialSliderPrivate +class SliderPrivate { - Q_DISABLE_COPY(QtMaterialSliderPrivate) - Q_DECLARE_PUBLIC(QtMaterialSlider) + Q_DISABLE_COPY(SliderPrivate) + Q_DECLARE_PUBLIC(Slider) public: - QtMaterialSliderPrivate(QtMaterialSlider *q); - ~QtMaterialSliderPrivate(); + SliderPrivate(Slider *q); + ~SliderPrivate(); void init(); @@ -28,10 +30,10 @@ class QtMaterialSliderPrivate void setHovered(bool status); - QtMaterialSlider *const q_ptr; - QtMaterialSliderThumb *thumb; - QtMaterialSliderTrack *track; - QtMaterialSliderStateMachine *stateMachine; + Slider *const q_ptr; + SliderThumb *thumb; + SliderTrack *track; + SliderStateMachine *stateMachine; QColor thumbColor; QColor trackColor; QColor disabledColor; @@ -45,5 +47,5 @@ class QtMaterialSliderPrivate bool pageStepMode; bool useThemeColors; }; - +} #endif // QTMATERIALSLIDER_P_H From 80f7bbdb47d4eb170b39cb55eda12b2ff0ab73b9 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 03:57:43 +0100 Subject: [PATCH 25/46] Snackbar moved to md. --- components/qtmaterialsnackbar.cpp | 107 +++++++++++---------- components/qtmaterialsnackbar.h | 18 ++-- components/qtmaterialsnackbar_internal.cpp | 29 +++--- components/qtmaterialsnackbar_internal.h | 18 ++-- components/qtmaterialsnackbar_p.h | 22 +++-- 5 files changed, 103 insertions(+), 91 deletions(-) diff --git a/components/qtmaterialsnackbar.cpp b/components/qtmaterialsnackbar.cpp index 323ff20fe..7b898c113 100644 --- a/components/qtmaterialsnackbar.cpp +++ b/components/qtmaterialsnackbar.cpp @@ -6,26 +6,28 @@ #include "lib/qtmaterialstyle.h" #include "lib/qtmaterialstatetransition.h" #include +namespace md +{ /*! * \class QtMaterialSnackbarPrivate * \internal */ -QtMaterialSnackbarPrivate::QtMaterialSnackbarPrivate(QtMaterialSnackbar *q) +SnackBarPrivate::SnackBarPrivate(SnackBar *q) : q_ptr(q) { } -QtMaterialSnackbarPrivate::~QtMaterialSnackbarPrivate() +SnackBarPrivate::~SnackBarPrivate() { } -void QtMaterialSnackbarPrivate::init() +void SnackBarPrivate::init() { - Q_Q(QtMaterialSnackbar); + Q_Q(SnackBar); - stateMachine = new QtMaterialSnackbarStateMachine(q); + stateMachine = new SnackBarStateMachine(q); bgOpacity = 0.9; duration = 3000; boxWidth = 300; @@ -46,34 +48,34 @@ void QtMaterialSnackbarPrivate::init() * \class QtMaterialSnackbar */ -QtMaterialSnackbar::QtMaterialSnackbar(QWidget *parent) - : QtMaterialOverlayWidget(parent), - d_ptr(new QtMaterialSnackbarPrivate(this)) +SnackBar::SnackBar(QWidget *parent) + : OverlayWidget(parent), + d_ptr(new SnackBarPrivate(this)) { d_func()->init(); } -QtMaterialSnackbar::~QtMaterialSnackbar() +SnackBar::~SnackBar() { } -void QtMaterialSnackbar::setAutoHideDuration(int duration) +void SnackBar::setAutoHideDuration(int duration) { - Q_D(QtMaterialSnackbar); + Q_D(SnackBar); d->duration = duration; } -int QtMaterialSnackbar::autoHideDuration() const +int SnackBar::autoHideDuration() const { - Q_D(const QtMaterialSnackbar); + Q_D(const SnackBar); return d->duration; } -void QtMaterialSnackbar::setUseThemeColors(bool value) +void SnackBar::setUseThemeColors(bool value) { - Q_D(QtMaterialSnackbar); + Q_D(SnackBar); if (d->useThemeColors == value) { return; @@ -83,16 +85,16 @@ void QtMaterialSnackbar::setUseThemeColors(bool value) update(); } -bool QtMaterialSnackbar::useThemeColors() const +bool SnackBar::useThemeColors() const { - Q_D(const QtMaterialSnackbar); + Q_D(const SnackBar); return d->useThemeColors; } -void QtMaterialSnackbar::setBackgroundColor(const QColor &color) +void SnackBar::setBackgroundColor(const QColor &color) { - Q_D(QtMaterialSnackbar); + Q_D(SnackBar); d->backgroundColor = color; @@ -100,35 +102,35 @@ void QtMaterialSnackbar::setBackgroundColor(const QColor &color) update(); } -QColor QtMaterialSnackbar::backgroundColor() const +QColor SnackBar::backgroundColor() const { - Q_D(const QtMaterialSnackbar); + Q_D(const SnackBar); if (d->useThemeColors || !d->backgroundColor.isValid()) { - return QtMaterialStyle::instance().themeColor("text"); + return Style::instance().themeColor("text"); } else { return d->backgroundColor; } } -void QtMaterialSnackbar::setBackgroundOpacity(qreal opacity) +void SnackBar::setBackgroundOpacity(qreal opacity) { - Q_D(QtMaterialSnackbar); + Q_D(SnackBar); d->bgOpacity = opacity; update(); } -qreal QtMaterialSnackbar::backgroundOpacity() const +qreal SnackBar::backgroundOpacity() const { - Q_D(const QtMaterialSnackbar); + Q_D(const SnackBar); return d->bgOpacity; } -void QtMaterialSnackbar::setTextColor(const QColor &color) +void SnackBar::setTextColor(const QColor &color) { - Q_D(QtMaterialSnackbar); + Q_D(SnackBar); d->textColor = color; @@ -136,18 +138,18 @@ void QtMaterialSnackbar::setTextColor(const QColor &color) update(); } -QColor QtMaterialSnackbar::textColor() const +QColor SnackBar::textColor() const { - Q_D(const QtMaterialSnackbar); + Q_D(const SnackBar); if (d->useThemeColors || !d->textColor.isValid()) { - return QtMaterialStyle::instance().themeColor("canvas"); + return Style::instance().themeColor("canvas"); } else { return d->textColor; } } -void QtMaterialSnackbar::setFontSize(qreal size) +void SnackBar::setFontSize(qreal size) { QFont f(font()); f.setPointSizeF(size); @@ -156,52 +158,52 @@ void QtMaterialSnackbar::setFontSize(qreal size) update(); } -qreal QtMaterialSnackbar::fontSize() const +qreal SnackBar::fontSize() const { return font().pointSizeF(); } -void QtMaterialSnackbar::setBoxWidth(int width) +void SnackBar::setBoxWidth(int width) { - Q_D(QtMaterialSnackbar); + Q_D(SnackBar); d->boxWidth = width; update(); } -int QtMaterialSnackbar::boxWidth() const +int SnackBar::boxWidth() const { - Q_D(const QtMaterialSnackbar); + Q_D(const SnackBar); return d->boxWidth; } -void QtMaterialSnackbar::setClickToDismissMode(bool value) +void SnackBar::setClickToDismissMode(bool value) { - Q_D(QtMaterialSnackbar); + Q_D(SnackBar); d->clickDismiss = value; } -bool QtMaterialSnackbar::clickToDismissMode() const +bool SnackBar::clickToDismissMode() const { - Q_D(const QtMaterialSnackbar); + Q_D(const SnackBar); return d->clickDismiss; } -void QtMaterialSnackbar::addMessage(const QString &message) +void SnackBar::addMessage(const QString &message) { - Q_D(QtMaterialSnackbar); + Q_D(SnackBar); d->messages.push_back(message); - d->stateMachine->postEvent(new QtMaterialStateTransitionEvent(SnackbarShowTransition)); + d->stateMachine->postEvent(new StateTransitionEvent(SnackbarShowTransition)); raise(); } -void QtMaterialSnackbar::addInstantMessage(const QString &message) +void SnackBar::addInstantMessage(const QString &message) { - Q_D(QtMaterialSnackbar); + Q_D(SnackBar); if (d->messages.isEmpty()) { d->messages.push_back(message); @@ -212,9 +214,9 @@ void QtMaterialSnackbar::addInstantMessage(const QString &message) d->stateMachine->progress(); } -void QtMaterialSnackbar::dequeue() +void SnackBar::dequeue() { - Q_D(QtMaterialSnackbar); + Q_D(SnackBar); if (d->messages.isEmpty()) { return; @@ -223,17 +225,17 @@ void QtMaterialSnackbar::dequeue() d->messages.removeFirst(); if (!d->messages.isEmpty()) { - d->stateMachine->postEvent(new QtMaterialStateTransitionEvent(SnackbarNextTransition)); + d->stateMachine->postEvent(new StateTransitionEvent(SnackbarNextTransition)); } else { - d->stateMachine->postEvent(new QtMaterialStateTransitionEvent(SnackbarWaitTransition)); + d->stateMachine->postEvent(new StateTransitionEvent(SnackbarWaitTransition)); } } -void QtMaterialSnackbar::paintEvent(QPaintEvent *event) +void SnackBar::paintEvent(QPaintEvent *event) { Q_UNUSED(event) - Q_D(QtMaterialSnackbar); + Q_D(SnackBar); if (d->messages.isEmpty()) { return; @@ -268,3 +270,4 @@ void QtMaterialSnackbar::paintEvent(QPaintEvent *event) painter.setPen(textColor()); painter.drawText(br, Qt::AlignHCenter | Qt::AlignTop | Qt::TextWordWrap, message); } +} diff --git a/components/qtmaterialsnackbar.h b/components/qtmaterialsnackbar.h index 6d9474001..547b0c2c7 100644 --- a/components/qtmaterialsnackbar.h +++ b/components/qtmaterialsnackbar.h @@ -2,16 +2,18 @@ #define QTMATERIALSNACKBAR_H #include "lib/qtmaterialoverlaywidget.h" +namespace md +{ -class QtMaterialSnackbarPrivate; +class SnackBarPrivate; -class QtMaterialSnackbar : public QtMaterialOverlayWidget +class SnackBar : public OverlayWidget { Q_OBJECT public: - explicit QtMaterialSnackbar(QWidget *parent = 0); - ~QtMaterialSnackbar(); + explicit SnackBar(QWidget *parent = 0); + ~SnackBar(); void setAutoHideDuration(int duration); int autoHideDuration() const; @@ -47,11 +49,11 @@ protected slots: protected: void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QtMaterialSnackbar) - Q_DECLARE_PRIVATE(QtMaterialSnackbar) + Q_DISABLE_COPY(SnackBar) + Q_DECLARE_PRIVATE(SnackBar) }; - +} #endif // QTMATERIALSNACKBAR_H diff --git a/components/qtmaterialsnackbar_internal.cpp b/components/qtmaterialsnackbar_internal.cpp index 9e6167d76..cb705bc27 100644 --- a/components/qtmaterialsnackbar_internal.cpp +++ b/components/qtmaterialsnackbar_internal.cpp @@ -3,8 +3,10 @@ #include "qtmaterialsnackbar.h" #include "lib/qtmaterialstatetransition.h" #include +namespace md +{ -QtMaterialSnackbarStateMachine::QtMaterialSnackbarStateMachine(QtMaterialSnackbar *parent) +SnackBarStateMachine::SnackBarStateMachine(SnackBar *parent) : QStateMachine(parent), m_snackbar(parent) { @@ -20,25 +22,25 @@ QtMaterialSnackbarStateMachine::QtMaterialSnackbarStateMachine(QtMaterialSnackba setInitialState(hiddenState); - QtMaterialStateTransition *transition; + StateTransition *transition; - transition = new QtMaterialStateTransition(SnackbarShowTransition); + transition = new StateTransition(SnackbarShowTransition); transition->setTargetState(visibleState); hiddenState->addTransition(transition); - transition = new QtMaterialStateTransition(SnackbarHideTransition); + transition = new StateTransition(SnackbarHideTransition); transition->setTargetState(visibleState); hiddenState->addTransition(transition); - transition = new QtMaterialStateTransition(SnackbarHideTransition); + transition = new StateTransition(SnackbarHideTransition); transition->setTargetState(finalState); visibleState->addTransition(transition); - transition = new QtMaterialStateTransition(SnackbarWaitTransition); + transition = new StateTransition(SnackbarWaitTransition); transition->setTargetState(hiddenState); finalState->addTransition(transition); - transition = new QtMaterialStateTransition(SnackbarNextTransition); + transition = new StateTransition(SnackbarNextTransition); transition->setTargetState(visibleState); finalState->addTransition(transition); @@ -63,11 +65,11 @@ QtMaterialSnackbarStateMachine::QtMaterialSnackbarStateMachine(QtMaterialSnackba m_snackbar->installEventFilter(this); } -QtMaterialSnackbarStateMachine::~QtMaterialSnackbarStateMachine() +SnackBarStateMachine::~SnackBarStateMachine() { } -bool QtMaterialSnackbarStateMachine::eventFilter(QObject *watched, QEvent *event) +bool SnackBarStateMachine::eventFilter(QObject *watched, QEvent *event) { if (QEvent::MouseButtonPress == event->type() && m_snackbar->clickToDismissMode()) { progress(); @@ -75,25 +77,26 @@ bool QtMaterialSnackbarStateMachine::eventFilter(QObject *watched, QEvent *event return QStateMachine::eventFilter(watched, event); } -void QtMaterialSnackbarStateMachine::setOffset(qreal offset) +void SnackBarStateMachine::setOffset(qreal offset) { m_offset = offset; m_snackbar->update(); } -void QtMaterialSnackbarStateMachine::progress() +void SnackBarStateMachine::progress() { m_timer.stop(); - postEvent(new QtMaterialStateTransitionEvent(SnackbarHideTransition)); + postEvent(new StateTransitionEvent(SnackbarHideTransition)); if (m_snackbar->clickToDismissMode()) { m_snackbar->setAttribute(Qt::WA_TransparentForMouseEvents, true); } } -void QtMaterialSnackbarStateMachine::snackbarShown() +void SnackBarStateMachine::snackbarShown() { m_timer.start(m_snackbar->autoHideDuration()); if (m_snackbar->clickToDismissMode()) { m_snackbar->setAttribute(Qt::WA_TransparentForMouseEvents, false); } } +} diff --git a/components/qtmaterialsnackbar_internal.h b/components/qtmaterialsnackbar_internal.h index 117a8e557..dbeb0de5e 100644 --- a/components/qtmaterialsnackbar_internal.h +++ b/components/qtmaterialsnackbar_internal.h @@ -3,18 +3,20 @@ #include #include +namespace md +{ -class QtMaterialSnackbar; +class SnackBar; -class QtMaterialSnackbarStateMachine : public QStateMachine +class SnackBarStateMachine : public QStateMachine { Q_OBJECT Q_PROPERTY(qreal offset WRITE setOffset READ offset) public: - QtMaterialSnackbarStateMachine(QtMaterialSnackbar *parent); - ~QtMaterialSnackbarStateMachine(); + SnackBarStateMachine(SnackBar *parent); + ~SnackBarStateMachine(); void setOffset(qreal offset); inline qreal offset() const; @@ -29,16 +31,16 @@ protected slots: bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(QtMaterialSnackbarStateMachine) + Q_DISABLE_COPY(SnackBarStateMachine) - QtMaterialSnackbar *const m_snackbar; + SnackBar *const m_snackbar; QTimer m_timer; qreal m_offset; }; -inline qreal QtMaterialSnackbarStateMachine::offset() const +inline qreal SnackBarStateMachine::offset() const { return m_offset; } - +} #endif // QTMATERIALSNACKBAR_INTERNAL_H diff --git a/components/qtmaterialsnackbar_p.h b/components/qtmaterialsnackbar_p.h index 39501fd25..828cdf44d 100644 --- a/components/qtmaterialsnackbar_p.h +++ b/components/qtmaterialsnackbar_p.h @@ -3,23 +3,25 @@ #include #include +namespace md +{ -class QtMaterialSnackbar; -class QtMaterialSnackbarStateMachine; +class SnackBar; +class SnackBarStateMachine; -class QtMaterialSnackbarPrivate +class SnackBarPrivate { - Q_DISABLE_COPY(QtMaterialSnackbarPrivate) - Q_DECLARE_PUBLIC(QtMaterialSnackbar) + Q_DISABLE_COPY(SnackBarPrivate) + Q_DECLARE_PUBLIC(Snackbar) public: - QtMaterialSnackbarPrivate(QtMaterialSnackbar *q); - ~QtMaterialSnackbarPrivate(); + SnackBarPrivate(SnackBar *q); + ~SnackBarPrivate(); void init(); - QtMaterialSnackbar *const q_ptr; - QtMaterialSnackbarStateMachine *stateMachine; + SnackBar *const q_ptr; + SnackBarStateMachine *stateMachine; QColor backgroundColor; QColor textColor; qreal bgOpacity; @@ -29,5 +31,5 @@ class QtMaterialSnackbarPrivate bool clickDismiss; bool useThemeColors; }; - +} #endif // QTMATERIALSNACKBAR_P_H From 0fee3cf4341dd7d2c5e1adcae5a55772053b4cc9 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 04:03:49 +0100 Subject: [PATCH 26/46] Tabs --- components/qtmaterialtabs.cpp | 109 +++++++++++++------------ components/qtmaterialtabs.h | 22 ++--- components/qtmaterialtabs_internal.cpp | 33 ++++---- components/qtmaterialtabs_internal.h | 35 ++++---- components/qtmaterialtabs_p.h | 22 ++--- 5 files changed, 117 insertions(+), 104 deletions(-) diff --git a/components/qtmaterialtabs.cpp b/components/qtmaterialtabs.cpp index dbc55bdbd..d5e5defce 100644 --- a/components/qtmaterialtabs.cpp +++ b/components/qtmaterialtabs.cpp @@ -3,26 +3,28 @@ #include #include "qtmaterialtabs_internal.h" #include "lib/qtmaterialstyle.h" +namespace md +{ /*! * \QtMaterialTabsPrivate * \internal */ -QtMaterialTabsPrivate::QtMaterialTabsPrivate(QtMaterialTabs *q) +TabsPrivate::TabsPrivate(Tabs *q) : q_ptr(q) { } -QtMaterialTabsPrivate::~QtMaterialTabsPrivate() +TabsPrivate::~TabsPrivate() { } -void QtMaterialTabsPrivate::QtMaterialTabsPrivate::init() +void TabsPrivate::TabsPrivate::init() { - Q_Q(QtMaterialTabs); + Q_Q(Tabs); - inkBar = new QtMaterialTabsInkBar(q); + inkBar = new TabsInkBar(q); tabLayout = new QHBoxLayout; rippleStyle = Material::CenteredRipple; tab = -1; @@ -30,7 +32,7 @@ void QtMaterialTabsPrivate::QtMaterialTabsPrivate::init() useThemeColors = true; q->setLayout(tabLayout); - q->setStyle(&QtMaterialStyle::instance()); + q->setStyle(&Style::instance()); tabLayout->setSpacing(0); tabLayout->setMargin(0); @@ -40,64 +42,64 @@ void QtMaterialTabsPrivate::QtMaterialTabsPrivate::init() * \QtMaterialTabs */ -QtMaterialTabs::QtMaterialTabs(QWidget *parent) +Tabs::Tabs(QWidget *parent) : QWidget(parent), - d_ptr(new QtMaterialTabsPrivate(this)) + d_ptr(new TabsPrivate(this)) { d_func()->init(); } -QtMaterialTabs::~QtMaterialTabs() +Tabs::~Tabs() { } -void QtMaterialTabs::setUseThemeColors(bool value) +void Tabs::setUseThemeColors(bool value) { - Q_D(QtMaterialTabs); + Q_D(Tabs); d->useThemeColors = value; } -bool QtMaterialTabs::useThemeColors() const +bool Tabs::useThemeColors() const { - Q_D(const QtMaterialTabs); + Q_D(const Tabs); return d->useThemeColors; } -void QtMaterialTabs::setHaloVisible(bool value) +void Tabs::setHaloVisible(bool value) { - Q_D(QtMaterialTabs); + Q_D(Tabs); d->showHalo = value; updateTabs(); } -bool QtMaterialTabs::isHaloVisible() const +bool Tabs::isHaloVisible() const { - Q_D(const QtMaterialTabs); + Q_D(const Tabs); return d->showHalo; } -void QtMaterialTabs::setRippleStyle(Material::RippleStyle style) +void Tabs::setRippleStyle(Material::RippleStyle style) { - Q_D(QtMaterialTabs); + Q_D(Tabs); d->rippleStyle = style; updateTabs(); } -Material::RippleStyle QtMaterialTabs::rippleStyle() const +Material::RippleStyle Tabs::rippleStyle() const { - Q_D(const QtMaterialTabs); + Q_D(const Tabs); return d->rippleStyle; } -void QtMaterialTabs::setInkColor(const QColor &color) +void Tabs::setInkColor(const QColor &color) { - Q_D(QtMaterialTabs); + Q_D(Tabs); d->inkColor = color; @@ -106,20 +108,20 @@ void QtMaterialTabs::setInkColor(const QColor &color) update(); } -QColor QtMaterialTabs::inkColor() const +QColor Tabs::inkColor() const { - Q_D(const QtMaterialTabs); + Q_D(const Tabs); if (d->useThemeColors || !d->inkColor.isValid()) { - return QtMaterialStyle::instance().themeColor("accent1"); + return Style::instance().themeColor("accent1"); } else { return d->inkColor; } } -void QtMaterialTabs::setBackgroundColor(const QColor &color) +void Tabs::setBackgroundColor(const QColor &color) { - Q_D(QtMaterialTabs); + Q_D(Tabs); d->backgroundColor = color; @@ -128,20 +130,20 @@ void QtMaterialTabs::setBackgroundColor(const QColor &color) update(); } -QColor QtMaterialTabs::backgroundColor() const +QColor Tabs::backgroundColor() const { - Q_D(const QtMaterialTabs); + Q_D(const Tabs); if (d->useThemeColors || !d->backgroundColor.isValid()) { - return QtMaterialStyle::instance().themeColor("primary1"); + return Style::instance().themeColor("primary1"); } else { return d->backgroundColor; } } -void QtMaterialTabs::setTextColor(const QColor &color) +void Tabs::setTextColor(const QColor &color) { - Q_D(QtMaterialTabs); + Q_D(Tabs); d->textColor = color; @@ -150,27 +152,27 @@ void QtMaterialTabs::setTextColor(const QColor &color) update(); } -QColor QtMaterialTabs::textColor() const +QColor Tabs::textColor() const { - Q_D(const QtMaterialTabs); + Q_D(const Tabs); if (d->useThemeColors || !d->textColor.isValid()) { - return QtMaterialStyle::instance().themeColor("canvas"); + return Style::instance().themeColor("canvas"); } else { return d->textColor; } } -void QtMaterialTabs::setCurrentTab(QtMaterialTab *tab) +void Tabs::setCurrentTab(Tab *tab) { - Q_D(QtMaterialTabs); + Q_D(Tabs); setCurrentTab(d->tabLayout->indexOf(tab)); } -void QtMaterialTabs::setCurrentTab(int index) +void Tabs::setCurrentTab(int index) { - Q_D(QtMaterialTabs); + Q_D(Tabs); setTabActive(d->tab, false); d->tab = index; @@ -180,11 +182,11 @@ void QtMaterialTabs::setCurrentTab(int index) emit currentChanged(index); } -void QtMaterialTabs::addTab(const QString &text, const QIcon &icon) +void Tabs::addTab(const QString &text, const QIcon &icon) { - Q_D(QtMaterialTabs); + Q_D(Tabs); - QtMaterialTab *tab = new QtMaterialTab(this); + Tab *tab = new Tab(this); tab->setText(text); tab->setHaloVisible(isHaloVisible()); tab->setRippleStyle(rippleStyle()); @@ -204,35 +206,35 @@ void QtMaterialTabs::addTab(const QString &text, const QIcon &icon) } } -int QtMaterialTabs::currentIndex() const +int Tabs::currentIndex() const { - Q_D(const QtMaterialTabs); + Q_D(const Tabs); return d->tab; } -void QtMaterialTabs::setTabActive(int index, bool active) +void Tabs::setTabActive(int index, bool active) { - Q_D(QtMaterialTabs); + Q_D(Tabs); - QtMaterialTab *tab; + Tab *tab; if (index > -1) { - tab = static_cast(d->tabLayout->itemAt(index)->widget()); + tab = static_cast(d->tabLayout->itemAt(index)->widget()); if (tab) { tab->setActive(active); } } } -void QtMaterialTabs::updateTabs() +void Tabs::updateTabs() { - Q_D(QtMaterialTabs); + Q_D(Tabs); - QtMaterialTab *tab; + Tab *tab; for (int i = 0; i < d->tabLayout->count(); ++i) { QLayoutItem *item = d->tabLayout->itemAt(i); - if ((tab = static_cast(item->widget()))) { + if ((tab = static_cast(item->widget()))) { tab->setRippleStyle(d->rippleStyle); tab->setHaloVisible(d->showHalo); tab->setBackgroundColor(backgroundColor()); @@ -240,3 +242,4 @@ void QtMaterialTabs::updateTabs() } } } +} diff --git a/components/qtmaterialtabs.h b/components/qtmaterialtabs.h index 11a122ee8..ba505446c 100644 --- a/components/qtmaterialtabs.h +++ b/components/qtmaterialtabs.h @@ -4,17 +4,19 @@ #include #include #include "lib/qtmaterialtheme.h" +namespace md +{ -class QtMaterialTabsPrivate; -class QtMaterialTab; +class TabsPrivate; +class Tab; -class QtMaterialTabs : public QWidget +class Tabs : public QWidget { Q_OBJECT public: - explicit QtMaterialTabs(QWidget *parent = 0); - ~QtMaterialTabs(); + explicit Tabs(QWidget *parent = 0); + ~Tabs(); void setUseThemeColors(bool value); bool useThemeColors() const; @@ -36,7 +38,7 @@ class QtMaterialTabs : public QWidget void addTab(const QString &text, const QIcon &icon = QIcon()); - void setCurrentTab(QtMaterialTab *tab); + void setCurrentTab(Tab *tab); void setCurrentTab(int index); int currentIndex() const; @@ -48,11 +50,11 @@ class QtMaterialTabs : public QWidget void setTabActive(int index, bool active = true); void updateTabs(); - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QtMaterialTabs) - Q_DECLARE_PRIVATE(QtMaterialTabs) + Q_DISABLE_COPY(Tabs) + Q_DECLARE_PRIVATE(Tabs) }; - +} #endif // QTMATERIALTABS_H diff --git a/components/qtmaterialtabs_internal.cpp b/components/qtmaterialtabs_internal.cpp index e952c0254..06e9c7ff0 100644 --- a/components/qtmaterialtabs_internal.cpp +++ b/components/qtmaterialtabs_internal.cpp @@ -6,14 +6,16 @@ #include #include "qtmaterialtabs.h" #include +namespace md +{ /*! * \class QtMaterialTabsInkBar * \internal */ -QtMaterialTabsInkBar::QtMaterialTabsInkBar(QtMaterialTabs *parent) - : QtMaterialOverlayWidget(parent), +TabsInkBar::TabsInkBar(Tabs *parent) + : OverlayWidget(parent), m_tabs(parent), m_animation(new QPropertyAnimation(parent)), m_tween(0) @@ -31,11 +33,11 @@ QtMaterialTabsInkBar::QtMaterialTabsInkBar(QtMaterialTabs *parent) setAttribute(Qt::WA_NoSystemBackground); } -QtMaterialTabsInkBar::~QtMaterialTabsInkBar() +TabsInkBar::~TabsInkBar() { } -void QtMaterialTabsInkBar::refreshGeometry() +void TabsInkBar::refreshGeometry() { QLayoutItem *item = m_tabs->layout()->itemAt(m_tabs->currentIndex()); @@ -55,7 +57,7 @@ void QtMaterialTabsInkBar::refreshGeometry() } } -void QtMaterialTabsInkBar::animate() +void TabsInkBar::animate() { raise(); @@ -67,7 +69,7 @@ void QtMaterialTabsInkBar::animate() m_animation->start(); } -bool QtMaterialTabsInkBar::eventFilter(QObject *obj, QEvent *event) +bool TabsInkBar::eventFilter(QObject *obj, QEvent *event) { switch (event->type()) { @@ -80,10 +82,10 @@ bool QtMaterialTabsInkBar::eventFilter(QObject *obj, QEvent *event) default: break; } - return QtMaterialOverlayWidget::eventFilter(obj, event); + return OverlayWidget::eventFilter(obj, event); } -void QtMaterialTabsInkBar::paintEvent(QPaintEvent *event) +void TabsInkBar::paintEvent(QPaintEvent *event) { Q_UNUSED(event) @@ -98,8 +100,8 @@ void QtMaterialTabsInkBar::paintEvent(QPaintEvent *event) * \internal */ -QtMaterialTab::QtMaterialTab(QtMaterialTabs *parent) - : QtMaterialFlatButton(parent), +Tab::Tab(Tabs *parent) + : FlatButton(parent), m_tabs(parent), m_active(false) { @@ -119,25 +121,25 @@ QtMaterialTab::QtMaterialTab(QtMaterialTabs *parent) connect(this, SIGNAL(clicked(bool)), this, SLOT(activateTab())); } -QtMaterialTab::~QtMaterialTab() +Tab::~Tab() { } -QSize QtMaterialTab::sizeHint() const +QSize Tab::sizeHint() const { if (icon().isNull()) { - return QtMaterialFlatButton::sizeHint(); + return FlatButton::sizeHint(); } else { return QSize(40, iconSize().height()+46); } } -void QtMaterialTab::activateTab() +void Tab::activateTab() { m_tabs->setCurrentTab(this); } -void QtMaterialTab::paintForeground(QPainter *painter) +void Tab::paintForeground(QPainter *painter) { painter->setPen(foregroundColor()); @@ -176,3 +178,4 @@ void QtMaterialTab::paintForeground(QPainter *painter) painter->fillRect(rect(), overlay); } } +} diff --git a/components/qtmaterialtabs_internal.h b/components/qtmaterialtabs_internal.h index 75dc03478..81f82f507 100644 --- a/components/qtmaterialtabs_internal.h +++ b/components/qtmaterialtabs_internal.h @@ -4,18 +4,21 @@ #include "lib/qtmaterialoverlaywidget.h" #include "qtmaterialflatbutton.h" +namespace md +{ + class QPropertyAnimation; -class QtMaterialTabs; +class Tabs; -class QtMaterialTabsInkBar : public QtMaterialOverlayWidget +class TabsInkBar : public OverlayWidget { Q_OBJECT Q_PROPERTY(qreal tweenValue WRITE setTweenValue READ tweenValue) public: - QtMaterialTabsInkBar(QtMaterialTabs *parent); - ~QtMaterialTabsInkBar(); + TabsInkBar(Tabs *parent); + ~TabsInkBar(); inline void setTweenValue(qreal value); inline qreal tweenValue() const; @@ -28,33 +31,33 @@ class QtMaterialTabsInkBar : public QtMaterialOverlayWidget void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(QtMaterialTabsInkBar) + Q_DISABLE_COPY(TabsInkBar) - QtMaterialTabs *const m_tabs; + Tabs *const m_tabs; QPropertyAnimation *const m_animation; QRect m_geometry; QRect m_previousGeometry; qreal m_tween; }; -inline void QtMaterialTabsInkBar::setTweenValue(qreal value) +inline void TabsInkBar::setTweenValue(qreal value) { m_tween = value; refreshGeometry(); } -inline qreal QtMaterialTabsInkBar::tweenValue() const +inline qreal TabsInkBar::tweenValue() const { return m_tween; } -class QtMaterialTab : public QtMaterialFlatButton +class Tab : public FlatButton { Q_OBJECT public: - explicit QtMaterialTab(QtMaterialTabs *parent); - ~QtMaterialTab(); + explicit Tab(Tabs *parent); + ~Tab(); inline void setActive(bool state); inline bool isActive() const; @@ -68,21 +71,21 @@ protected slots: void paintForeground(QPainter *painter) Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(QtMaterialTab) + Q_DISABLE_COPY(Tab) - QtMaterialTabs *const m_tabs; + Tabs *const m_tabs; bool m_active; }; -inline void QtMaterialTab::setActive(bool state) +inline void Tab::setActive(bool state) { m_active = state; update(); } -inline bool QtMaterialTab::isActive() const +inline bool Tab::isActive() const { return m_active; } - +} #endif // QTMATERIALTABS_INTERNAL_H diff --git a/components/qtmaterialtabs_p.h b/components/qtmaterialtabs_p.h index 1f32b04ed..e9165de7d 100644 --- a/components/qtmaterialtabs_p.h +++ b/components/qtmaterialtabs_p.h @@ -3,24 +3,26 @@ #include #include "lib/qtmaterialtheme.h" +namespace md +{ class QHBoxLayout; -class QtMaterialTabs; -class QtMaterialTabsInkBar; +class Tabs; +class TabsInkBar; -class QtMaterialTabsPrivate +class TabsPrivate { - Q_DISABLE_COPY(QtMaterialTabsPrivate) - Q_DECLARE_PUBLIC(QtMaterialTabs) + Q_DISABLE_COPY(TabsPrivate) + Q_DECLARE_PUBLIC(Tabs) public: - QtMaterialTabsPrivate(QtMaterialTabs *q); - ~QtMaterialTabsPrivate(); + TabsPrivate(Tabs *q); + ~TabsPrivate(); void init(); - QtMaterialTabs *const q_ptr; - QtMaterialTabsInkBar *inkBar; + Tabs *const q_ptr; + TabsInkBar *inkBar; QHBoxLayout *tabLayout; Material::RippleStyle rippleStyle; QColor inkColor; @@ -30,5 +32,5 @@ class QtMaterialTabsPrivate bool showHalo; bool useThemeColors; }; - +} #endif // QTMATERIALTABS_P_H From a910b39a2f0e8cf6e36ac2005dd0d89fde67735e Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 04:08:05 +0100 Subject: [PATCH 27/46] TextField moved to md --- components/qtmaterialtextfield.cpp | 113 ++++++++++---------- components/qtmaterialtextfield.h | 20 ++-- components/qtmaterialtextfield_internal.cpp | 17 +-- components/qtmaterialtextfield_internal.h | 46 ++++---- components/qtmaterialtextfield_p.h | 25 +++-- 5 files changed, 117 insertions(+), 104 deletions(-) diff --git a/components/qtmaterialtextfield.cpp b/components/qtmaterialtextfield.cpp index 080da8291..938a8116c 100644 --- a/components/qtmaterialtextfield.cpp +++ b/components/qtmaterialtextfield.cpp @@ -5,26 +5,28 @@ #include "qtmaterialtextfield_internal.h" #include "lib/qtmaterialstyle.h" #include +namespace md +{ /*! * \class QtMaterialTextFieldPrivate * \internal */ -QtMaterialTextFieldPrivate::QtMaterialTextFieldPrivate(QtMaterialTextField *q) +TextFieldPrivate::TextFieldPrivate(TextField *q) : q_ptr(q) { } -QtMaterialTextFieldPrivate::~QtMaterialTextFieldPrivate() +TextFieldPrivate::~TextFieldPrivate() { } -void QtMaterialTextFieldPrivate::init() +void TextFieldPrivate::init() { - Q_Q(QtMaterialTextField); + Q_Q(TextField); - stateMachine = new QtMaterialTextFieldStateMachine(q); + stateMachine = new TextFieldStateMachine(q); label = 0; labelFontSize = 9.5; showLabel = false; @@ -32,7 +34,7 @@ void QtMaterialTextFieldPrivate::init() useThemeColors = true; q->setFrame(false); - q->setStyle(&QtMaterialStyle::instance()); + q->setStyle(&Style::instance()); q->setAttribute(Qt::WA_Hover); q->setMouseTracking(true); q->setTextMargins(0, 2, 0, 4); @@ -47,20 +49,20 @@ void QtMaterialTextFieldPrivate::init() * \class QtMaterialTextField */ -QtMaterialTextField::QtMaterialTextField(QWidget *parent) +TextField::TextField(QWidget *parent) : QLineEdit(parent), - d_ptr(new QtMaterialTextFieldPrivate(this)) + d_ptr(new TextFieldPrivate(this)) { d_func()->init(); } -QtMaterialTextField::~QtMaterialTextField() +TextField::~TextField() { } -void QtMaterialTextField::setUseThemeColors(bool value) +void TextField::setUseThemeColors(bool value) { - Q_D(QtMaterialTextField); + Q_D(TextField); if (d->useThemeColors == value) { return; @@ -70,16 +72,16 @@ void QtMaterialTextField::setUseThemeColors(bool value) d->stateMachine->setupProperties(); } -bool QtMaterialTextField::useThemeColors() const +bool TextField::useThemeColors() const { - Q_D(const QtMaterialTextField); + Q_D(const TextField); return d->useThemeColors; } -void QtMaterialTextField::setShowLabel(bool value) +void TextField::setShowLabel(bool value) { - Q_D(QtMaterialTextField); + Q_D(TextField); if (d->showLabel == value) { return; @@ -88,7 +90,7 @@ void QtMaterialTextField::setShowLabel(bool value) d->showLabel = value; if (!d->label && value) { - d->label = new QtMaterialTextFieldLabel(this); + d->label = new TextFieldLabel(this); d->stateMachine->setLabel(d->label); } @@ -99,16 +101,16 @@ void QtMaterialTextField::setShowLabel(bool value) } } -bool QtMaterialTextField::hasLabel() const +bool TextField::hasLabel() const { - Q_D(const QtMaterialTextField); + Q_D(const TextField); return d->showLabel; } -void QtMaterialTextField::setLabelFontSize(qreal size) +void TextField::setLabelFontSize(qreal size) { - Q_D(QtMaterialTextField); + Q_D(TextField); d->labelFontSize = size; @@ -121,32 +123,32 @@ void QtMaterialTextField::setLabelFontSize(qreal size) } } -qreal QtMaterialTextField::labelFontSize() const +qreal TextField::labelFontSize() const { - Q_D(const QtMaterialTextField); + Q_D(const TextField); return d->labelFontSize; } -void QtMaterialTextField::setLabel(const QString &label) +void TextField::setLabel(const QString &label) { - Q_D(QtMaterialTextField); + Q_D(TextField); d->labelString = label; setShowLabel(true); d->label->update(); } -QString QtMaterialTextField::label() const +QString TextField::label() const { - Q_D(const QtMaterialTextField); + Q_D(const TextField); return d->labelString; } -void QtMaterialTextField::setTextColor(const QColor &color) +void TextField::setTextColor(const QColor &color) { - Q_D(QtMaterialTextField); + Q_D(TextField); d->textColor = color; setStyleSheet(QString("QLineEdit { color: %1; }").arg(color.name())); @@ -155,20 +157,20 @@ void QtMaterialTextField::setTextColor(const QColor &color) d->stateMachine->setupProperties(); } -QColor QtMaterialTextField::textColor() const +QColor TextField::textColor() const { - Q_D(const QtMaterialTextField); + Q_D(const TextField); if (d->useThemeColors || !d->textColor.isValid()) { - return QtMaterialStyle::instance().themeColor("text"); + return Style::instance().themeColor("text"); } else { return d->textColor; } } -void QtMaterialTextField::setLabelColor(const QColor &color) +void TextField::setLabelColor(const QColor &color) { - Q_D(QtMaterialTextField); + Q_D(TextField); d->labelColor = color; @@ -176,20 +178,20 @@ void QtMaterialTextField::setLabelColor(const QColor &color) d->stateMachine->setupProperties(); } -QColor QtMaterialTextField::labelColor() const +QColor TextField::labelColor() const { - Q_D(const QtMaterialTextField); + Q_D(const TextField); if (d->useThemeColors || !d->labelColor.isValid()) { - return QtMaterialStyle::instance().themeColor("accent3"); + return Style::instance().themeColor("accent3"); } else { return d->labelColor; } } -void QtMaterialTextField::setInkColor(const QColor &color) +void TextField::setInkColor(const QColor &color) { - Q_D(QtMaterialTextField); + Q_D(TextField); d->inkColor = color; @@ -197,20 +199,20 @@ void QtMaterialTextField::setInkColor(const QColor &color) d->stateMachine->setupProperties(); } -QColor QtMaterialTextField::inkColor() const +QColor TextField::inkColor() const { - Q_D(const QtMaterialTextField); + Q_D(const TextField); if (d->useThemeColors || !d->inkColor.isValid()) { - return QtMaterialStyle::instance().themeColor("primary1"); + return Style::instance().themeColor("primary1"); } else { return d->inkColor; } } -void QtMaterialTextField::setInputLineColor(const QColor &color) +void TextField::setInputLineColor(const QColor &color) { - Q_D(QtMaterialTextField); + Q_D(TextField); d->inputLineColor = color; @@ -218,20 +220,20 @@ void QtMaterialTextField::setInputLineColor(const QColor &color) d->stateMachine->setupProperties(); } -QColor QtMaterialTextField::inputLineColor() const +QColor TextField::inputLineColor() const { - Q_D(const QtMaterialTextField); + Q_D(const TextField); if (d->useThemeColors || !d->inputLineColor.isValid()) { - return QtMaterialStyle::instance().themeColor("border"); + return Style::instance().themeColor("border"); } else { return d->inputLineColor; } } -void QtMaterialTextField::setShowInputLine(bool value) +void TextField::setShowInputLine(bool value) { - Q_D(QtMaterialTextField); + Q_D(TextField); if (d->showInputLine == value) { return; @@ -241,14 +243,14 @@ void QtMaterialTextField::setShowInputLine(bool value) update(); } -bool QtMaterialTextField::hasInputLine() const +bool TextField::hasInputLine() const { - Q_D(const QtMaterialTextField); + Q_D(const TextField); return d->showInputLine; } -QtMaterialTextField::QtMaterialTextField(QtMaterialTextFieldPrivate &d, QWidget *parent) +TextField::TextField(TextFieldPrivate &d, QWidget *parent) : QLineEdit(parent), d_ptr(&d) { @@ -258,9 +260,9 @@ QtMaterialTextField::QtMaterialTextField(QtMaterialTextFieldPrivate &d, QWidget /*! * \reimp */ -bool QtMaterialTextField::event(QEvent *event) +bool TextField::event(QEvent *event) { - Q_D(QtMaterialTextField); + Q_D(TextField); switch (event->type()) { @@ -279,9 +281,9 @@ bool QtMaterialTextField::event(QEvent *event) /*! * \reimp */ -void QtMaterialTextField::paintEvent(QPaintEvent *event) +void TextField::paintEvent(QPaintEvent *event) { - Q_D(QtMaterialTextField); + Q_D(TextField); QLineEdit::paintEvent(event); @@ -324,3 +326,4 @@ void QtMaterialTextField::paintEvent(QPaintEvent *event) } } } +} diff --git a/components/qtmaterialtextfield.h b/components/qtmaterialtextfield.h index dead5cc49..c845809a4 100644 --- a/components/qtmaterialtextfield.h +++ b/components/qtmaterialtextfield.h @@ -3,10 +3,12 @@ #include #include +namespace md +{ -class QtMaterialTextFieldPrivate; +class TextFieldPrivate; -class QtMaterialTextField : public QLineEdit +class TextField : public QLineEdit { Q_OBJECT @@ -15,8 +17,8 @@ class QtMaterialTextField : public QLineEdit Q_PROPERTY(QColor inputLineColor WRITE setInputLineColor READ inputLineColor) public: - explicit QtMaterialTextField(QWidget *parent = 0); - ~QtMaterialTextField(); + explicit TextField(QWidget *parent = 0); + ~TextField(); void setUseThemeColors(bool value); bool useThemeColors() const; @@ -46,16 +48,16 @@ class QtMaterialTextField : public QLineEdit bool hasInputLine() const; protected: - QtMaterialTextField(QtMaterialTextFieldPrivate &d, QWidget *parent = 0); + TextField(TextFieldPrivate &d, QWidget *parent = 0); bool event(QEvent *event) Q_DECL_OVERRIDE; void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QtMaterialTextField) - Q_DECLARE_PRIVATE(QtMaterialTextField) + Q_DISABLE_COPY(TextField) + Q_DECLARE_PRIVATE(TextField) }; - +} #endif // QTMATERIALTEXTFIELD_H diff --git a/components/qtmaterialtextfield_internal.cpp b/components/qtmaterialtextfield_internal.cpp index b8b4ce7ff..fa148ce88 100644 --- a/components/qtmaterialtextfield_internal.cpp +++ b/components/qtmaterialtextfield_internal.cpp @@ -3,13 +3,15 @@ #include #include #include "qtmaterialtextfield.h" +namespace md +{ /*! * \class QtMaterialTextFieldStateMachine * \internal */ -QtMaterialTextFieldStateMachine::QtMaterialTextFieldStateMachine(QtMaterialTextField *parent) +TextFieldStateMachine::TextFieldStateMachine(TextField *parent) : QStateMachine(parent), m_textField(parent), m_normalState(new QState), @@ -55,11 +57,11 @@ QtMaterialTextFieldStateMachine::QtMaterialTextFieldStateMachine(QtMaterialTextF connect(m_textField, SIGNAL(textChanged(QString)), this, SLOT(setupProperties())); } -QtMaterialTextFieldStateMachine::~QtMaterialTextFieldStateMachine() +TextFieldStateMachine::~TextFieldStateMachine() { } -void QtMaterialTextFieldStateMachine::setLabel(QtMaterialTextFieldLabel *label) +void TextFieldStateMachine::setLabel(TextFieldLabel *label) { if (m_label) { delete m_label; @@ -92,7 +94,7 @@ void QtMaterialTextFieldStateMachine::setLabel(QtMaterialTextFieldLabel *label) setupProperties(); } -void QtMaterialTextFieldStateMachine::setupProperties() +void TextFieldStateMachine::setupProperties() { if (m_label) { @@ -123,7 +125,7 @@ void QtMaterialTextFieldStateMachine::setupProperties() * \internal */ -QtMaterialTextFieldLabel::QtMaterialTextFieldLabel(QtMaterialTextField *parent) +TextFieldLabel::TextFieldLabel(TextField *parent) : QWidget(parent), m_textField(parent), m_scale(1), @@ -138,14 +140,14 @@ QtMaterialTextFieldLabel::QtMaterialTextFieldLabel(QtMaterialTextField *parent) setFont(font); } -QtMaterialTextFieldLabel::~QtMaterialTextFieldLabel() +TextFieldLabel::~TextFieldLabel() { } /*! * \reimp */ -void QtMaterialTextFieldLabel::paintEvent(QPaintEvent *event) +void TextFieldLabel::paintEvent(QPaintEvent *event) { Q_UNUSED(event) @@ -162,3 +164,4 @@ void QtMaterialTextFieldLabel::paintEvent(QPaintEvent *event) QPointF pos(2+m_posX, height()-36+m_posY); painter.drawText(pos.x(), pos.y(), m_textField->label()); } +} diff --git a/components/qtmaterialtextfield_internal.h b/components/qtmaterialtextfield_internal.h index e510287a1..fd8ab5800 100644 --- a/components/qtmaterialtextfield_internal.h +++ b/components/qtmaterialtextfield_internal.h @@ -4,21 +4,23 @@ #include #include #include "qtmaterialtextfield.h" +namespace md +{ class QPropertyAnimation; -class QtMaterialTextFieldLabel; +class TextFieldLabel; -class QtMaterialTextFieldStateMachine : public QStateMachine +class TextFieldStateMachine : public QStateMachine { Q_OBJECT Q_PROPERTY(qreal progress WRITE setProgress READ progress) public: - QtMaterialTextFieldStateMachine(QtMaterialTextField *parent); - ~QtMaterialTextFieldStateMachine(); + TextFieldStateMachine(TextField *parent); + ~TextFieldStateMachine(); - void setLabel(QtMaterialTextFieldLabel *label); + void setLabel(TextFieldLabel *label); inline void setProgress(qreal progress); inline qreal progress() const; @@ -27,29 +29,29 @@ public slots: void setupProperties(); private: - Q_DISABLE_COPY(QtMaterialTextFieldStateMachine) + Q_DISABLE_COPY(TextFieldStateMachine) - QtMaterialTextField *const m_textField; + TextField *const m_textField; QState *const m_normalState; QState *const m_focusedState; - QtMaterialTextFieldLabel *m_label; + TextFieldLabel *m_label; QPropertyAnimation *m_offsetAnimation; QPropertyAnimation *m_colorAnimation; qreal m_progress; }; -inline void QtMaterialTextFieldStateMachine::setProgress(qreal progress) +inline void TextFieldStateMachine::setProgress(qreal progress) { m_progress = progress; m_textField->update(); } -inline qreal QtMaterialTextFieldStateMachine::progress() const +inline qreal TextFieldStateMachine::progress() const { return m_progress; } -class QtMaterialTextFieldLabel : public QWidget +class TextFieldLabel : public QWidget { Q_OBJECT @@ -58,8 +60,8 @@ class QtMaterialTextFieldLabel : public QWidget Q_PROPERTY(QColor color WRITE setColor READ color) public: - QtMaterialTextFieldLabel(QtMaterialTextField *parent); - ~QtMaterialTextFieldLabel(); + TextFieldLabel(TextField *parent); + ~TextFieldLabel(); inline void setScale(qreal scale); inline qreal scale() const; @@ -74,47 +76,47 @@ class QtMaterialTextFieldLabel : public QWidget void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(QtMaterialTextFieldLabel) + Q_DISABLE_COPY(TextFieldLabel) - QtMaterialTextField *const m_textField; + TextField *const m_textField; qreal m_scale; qreal m_posX; qreal m_posY; QColor m_color; }; -inline void QtMaterialTextFieldLabel::setScale(qreal scale) +inline void TextFieldLabel::setScale(qreal scale) { m_scale = scale; update(); } -inline qreal QtMaterialTextFieldLabel::scale() const +inline qreal TextFieldLabel::scale() const { return m_scale; } -inline void QtMaterialTextFieldLabel::setOffset(const QPointF &pos) +inline void TextFieldLabel::setOffset(const QPointF &pos) { m_posX = pos.x(); m_posY = pos.y(); update(); } -inline QPointF QtMaterialTextFieldLabel::offset() const +inline QPointF TextFieldLabel::offset() const { return QPointF(m_posX, m_posY); } -inline void QtMaterialTextFieldLabel::setColor(const QColor &color) +inline void TextFieldLabel::setColor(const QColor &color) { m_color = color; update(); } -inline QColor QtMaterialTextFieldLabel::color() const +inline QColor TextFieldLabel::color() const { return m_color; } - +} #endif // QTMATERIALTEXTFIELD_INTERNAL_H diff --git a/components/qtmaterialtextfield_p.h b/components/qtmaterialtextfield_p.h index 9e8c83540..a3682be73 100644 --- a/components/qtmaterialtextfield_p.h +++ b/components/qtmaterialtextfield_p.h @@ -4,24 +4,26 @@ #include #include -class QtMaterialTextField; -class QtMaterialTextFieldStateMachine; -class QtMaterialTextFieldLabel; +namespace md +{ +class TextField; +class TextFieldStateMachine; +class TextFieldLabel; -class QtMaterialTextFieldPrivate +class TextFieldPrivate { - Q_DISABLE_COPY(QtMaterialTextFieldPrivate) - Q_DECLARE_PUBLIC(QtMaterialTextField) + Q_DISABLE_COPY(TextFieldPrivate) + Q_DECLARE_PUBLIC(TextField) public: - QtMaterialTextFieldPrivate(QtMaterialTextField *q); - virtual ~QtMaterialTextFieldPrivate(); + TextFieldPrivate(TextField *q); + virtual ~TextFieldPrivate(); void init(); - QtMaterialTextField *const q_ptr; - QtMaterialTextFieldStateMachine *stateMachine; - QtMaterialTextFieldLabel *label; + TextField *const q_ptr; + TextFieldStateMachine *stateMachine; + TextFieldLabel *label; QColor textColor; QColor labelColor; QColor inkColor; @@ -32,5 +34,6 @@ class QtMaterialTextFieldPrivate bool showInputLine; bool useThemeColors; }; +} #endif // QTMATERIALTEXTFIELD_P_H From 803bce52818c97541771fb2328e2f4f2bdb85e73 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 04:12:00 +0100 Subject: [PATCH 28/46] Toggle --- components/qtmaterialtoggle.cpp | 93 ++++++++++++------------ components/qtmaterialtoggle.h | 18 +++-- components/qtmaterialtoggle_internal.cpp | 51 +++++++------ components/qtmaterialtoggle_internal.h | 58 ++++++++------- components/qtmaterialtoggle_p.h | 30 ++++---- 5 files changed, 131 insertions(+), 119 deletions(-) diff --git a/components/qtmaterialtoggle.cpp b/components/qtmaterialtoggle.cpp index 6d11fc986..08c820e09 100644 --- a/components/qtmaterialtoggle.cpp +++ b/components/qtmaterialtoggle.cpp @@ -6,28 +6,30 @@ #include #include "qtmaterialtoggle_internal.h" #include "lib/qtmaterialstyle.h" +namespace md +{ /*! * \class QtMaterialTogglePrivate * \internal */ -QtMaterialTogglePrivate::QtMaterialTogglePrivate(QtMaterialToggle *q) +TogglePrivate::TogglePrivate(Toggle *q) : q_ptr(q) { } -QtMaterialTogglePrivate::~QtMaterialTogglePrivate() +TogglePrivate::~TogglePrivate() { } -void QtMaterialTogglePrivate::init() +void TogglePrivate::init() { - Q_Q(QtMaterialToggle); + Q_Q(Toggle); - track = new QtMaterialToggleTrack(q); - thumb = new QtMaterialToggleThumb(q); - rippleOverlay = new QtMaterialToggleRippleOverlay(thumb, track, q); + track = new ToggleTrack(q); + thumb = new ToggleThumb(q); + rippleOverlay = new ToggleRippleOverlay(thumb, track, q); stateMachine = new QStateMachine(q); offState = new QState; onState = new QState; @@ -106,9 +108,9 @@ void QtMaterialTogglePrivate::init() QCoreApplication::processEvents(); } -void QtMaterialTogglePrivate::setupProperties() +void TogglePrivate::setupProperties() { - Q_Q(QtMaterialToggle); + Q_Q(Toggle); if (q->isEnabled()) { const qreal shift = thumb->shift(); @@ -134,35 +136,35 @@ void QtMaterialTogglePrivate::setupProperties() * \class QtMaterialToggle */ -QtMaterialToggle::QtMaterialToggle(QWidget *parent) +Toggle::Toggle(QWidget *parent) : QAbstractButton(parent), - d_ptr(new QtMaterialTogglePrivate(this)) + d_ptr(new TogglePrivate(this)) { d_func()->init(); } -QtMaterialToggle::~QtMaterialToggle() +Toggle::~Toggle() { } -void QtMaterialToggle::setUseThemeColors(bool value) +void Toggle::setUseThemeColors(bool value) { - Q_D(QtMaterialToggle); + Q_D(Toggle); d->useThemeColors = value; d->setupProperties(); } -bool QtMaterialToggle::useThemeColors() const +bool Toggle::useThemeColors() const { - Q_D(const QtMaterialToggle); + Q_D(const Toggle); return d->useThemeColors; } -void QtMaterialToggle::setDisabledColor(const QColor &color) +void Toggle::setDisabledColor(const QColor &color) { - Q_D(QtMaterialToggle); + Q_D(Toggle); d->disabledColor = color; @@ -170,20 +172,20 @@ void QtMaterialToggle::setDisabledColor(const QColor &color) d->setupProperties(); } -QColor QtMaterialToggle::disabledColor() const +QColor Toggle::disabledColor() const { - Q_D(const QtMaterialToggle); + Q_D(const Toggle); if (d->useThemeColors || !d->disabledColor.isValid()) { - return QtMaterialStyle::instance().themeColor("disabled"); + return Style::instance().themeColor("disabled"); } else { return d->disabledColor; } } -void QtMaterialToggle::setActiveColor(const QColor &color) +void Toggle::setActiveColor(const QColor &color) { - Q_D(QtMaterialToggle); + Q_D(Toggle); d->activeColor = color; @@ -191,20 +193,20 @@ void QtMaterialToggle::setActiveColor(const QColor &color) d->setupProperties(); } -QColor QtMaterialToggle::activeColor() const +QColor Toggle::activeColor() const { - Q_D(const QtMaterialToggle); + Q_D(const Toggle); if (d->useThemeColors || !d->activeColor.isValid()) { - return QtMaterialStyle::instance().themeColor("primary1"); + return Style::instance().themeColor("primary1"); } else { return d->activeColor; } } -void QtMaterialToggle::setInactiveColor(const QColor &color) +void Toggle::setInactiveColor(const QColor &color) { - Q_D(QtMaterialToggle); + Q_D(Toggle); d->inactiveColor = color; @@ -212,20 +214,20 @@ void QtMaterialToggle::setInactiveColor(const QColor &color) d->setupProperties(); } -QColor QtMaterialToggle::inactiveColor() const +QColor Toggle::inactiveColor() const { - Q_D(const QtMaterialToggle); + Q_D(const Toggle); if (d->useThemeColors || !d->inactiveColor.isValid()) { - return QtMaterialStyle::instance().themeColor("canvas"); + return Style::instance().themeColor("canvas"); } else { return d->inactiveColor; } } -void QtMaterialToggle::setTrackColor(const QColor &color) +void Toggle::setTrackColor(const QColor &color) { - Q_D(QtMaterialToggle); + Q_D(Toggle); d->trackColor = color; @@ -233,20 +235,20 @@ void QtMaterialToggle::setTrackColor(const QColor &color) d->setupProperties(); } -QColor QtMaterialToggle::trackColor() const +QColor Toggle::trackColor() const { - Q_D(const QtMaterialToggle); + Q_D(const Toggle); if (d->useThemeColors || !d->trackColor.isValid()) { - return QtMaterialStyle::instance().themeColor("accent3"); + return Style::instance().themeColor("accent3"); } else { return d->trackColor; } } -void QtMaterialToggle::setOrientation(Qt::Orientation orientation) +void Toggle::setOrientation(Qt::Orientation orientation) { - Q_D(QtMaterialToggle); + Q_D(Toggle); if (d->orientation == orientation) { return; @@ -256,25 +258,25 @@ void QtMaterialToggle::setOrientation(Qt::Orientation orientation) updateGeometry(); } -Qt::Orientation QtMaterialToggle::orientation() const +Qt::Orientation Toggle::orientation() const { - Q_D(const QtMaterialToggle); + Q_D(const Toggle); return d->orientation; } -QSize QtMaterialToggle::sizeHint() const +QSize Toggle::sizeHint() const { - Q_D(const QtMaterialToggle); + Q_D(const Toggle); return Qt::Horizontal == d->orientation ? QSize(64, 48) : QSize(48, 64); } -bool QtMaterialToggle::event(QEvent *event) +bool Toggle::event(QEvent *event) { - Q_D(QtMaterialToggle); + Q_D(Toggle); switch (event->type()) { @@ -292,7 +294,8 @@ bool QtMaterialToggle::event(QEvent *event) return QAbstractButton::event(event); } -void QtMaterialToggle::paintEvent(QPaintEvent *event) +void Toggle::paintEvent(QPaintEvent *event) { Q_UNUSED(event) } +} diff --git a/components/qtmaterialtoggle.h b/components/qtmaterialtoggle.h index 5d5a55701..25f0d0fcd 100644 --- a/components/qtmaterialtoggle.h +++ b/components/qtmaterialtoggle.h @@ -2,10 +2,12 @@ #define QTMATERIALTOGGLE_H #include +namespace md +{ -class QtMaterialTogglePrivate; +class TogglePrivate; -class QtMaterialToggle : public QAbstractButton +class Toggle : public QAbstractButton { Q_OBJECT @@ -15,8 +17,8 @@ class QtMaterialToggle : public QAbstractButton Q_PROPERTY(QColor trackColor WRITE setTrackColor READ trackColor) public: - explicit QtMaterialToggle(QWidget *parent = 0); - ~QtMaterialToggle(); + explicit Toggle(QWidget *parent = 0); + ~Toggle(); void setUseThemeColors(bool value); bool useThemeColors() const; @@ -42,11 +44,11 @@ class QtMaterialToggle : public QAbstractButton bool event(QEvent *event) Q_DECL_OVERRIDE; void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; - const QScopedPointer d_ptr; + const QScopedPointer d_ptr; private: - Q_DISABLE_COPY(QtMaterialToggle) - Q_DECLARE_PRIVATE(QtMaterialToggle) + Q_DISABLE_COPY(Toggle) + Q_DECLARE_PRIVATE(Toggle) }; - +} #endif // QTMATERIALTOGGLE_H diff --git a/components/qtmaterialtoggle_internal.cpp b/components/qtmaterialtoggle_internal.cpp index 9bcf82325..3579769f8 100644 --- a/components/qtmaterialtoggle_internal.cpp +++ b/components/qtmaterialtoggle_internal.cpp @@ -4,17 +4,19 @@ #include #include "qtmaterialtoggle.h" #include "lib/qtmaterialripple.h" +namespace md +{ /*! * \class QtMaterialToggleRippleOverlay * \internal */ -QtMaterialToggleRippleOverlay::QtMaterialToggleRippleOverlay( - QtMaterialToggleThumb *thumb, - QtMaterialToggleTrack *track, - QtMaterialToggle *parent) - : QtMaterialRippleOverlay(parent->parentWidget()), +ToggleRippleOverlay::ToggleRippleOverlay( + ToggleThumb *thumb, + ToggleTrack *track, + Toggle *parent) + : RippleOverlay(parent->parentWidget()), m_toggle(parent), m_thumb(thumb), m_track(track) @@ -24,11 +26,11 @@ QtMaterialToggleRippleOverlay::QtMaterialToggleRippleOverlay( thumb->installEventFilter(this); } -QtMaterialToggleRippleOverlay::~QtMaterialToggleRippleOverlay() +ToggleRippleOverlay::~ToggleRippleOverlay() { } -void QtMaterialToggleRippleOverlay::addToggleRipple() +void ToggleRippleOverlay::addToggleRipple() { if (!m_toggle->isEnabled()) { return; @@ -44,7 +46,7 @@ void QtMaterialToggleRippleOverlay::addToggleRipple() w = m_thumb->width()/2+10; } - QtMaterialRipple *ripple = new QtMaterialRipple(QPoint(10+t, 20+t)); + Ripple *ripple = new Ripple(QPoint(10+t, 20+t)); ripple->setColor(m_track->trackColor()); ripple->setRadiusEndValue(w); ripple->setOpacityStartValue(0.8); @@ -52,21 +54,21 @@ void QtMaterialToggleRippleOverlay::addToggleRipple() addRipple(ripple); } -bool QtMaterialToggleRippleOverlay::eventFilter(QObject *obj, QEvent *event) +bool ToggleRippleOverlay::eventFilter(QObject *obj, QEvent *event) { if (QEvent::Paint == event->type()) { setGeometry(overlayGeometry()); - QList::const_iterator i; - QList items = ripples(); + QList::const_iterator i; + QList items = ripples(); QColor color = m_track->trackColor(); for (i = items.begin(); i != items.end(); ++i) { (*i)->setColor(color); } } - return QtMaterialRippleOverlay::eventFilter(obj, event); + return RippleOverlay::eventFilter(obj, event); } -QRect QtMaterialToggleRippleOverlay::overlayGeometry() const +QRect ToggleRippleOverlay::overlayGeometry() const { const qreal offset = m_thumb->offset(); if (Qt::Horizontal == m_toggle->orientation()) { @@ -81,7 +83,7 @@ QRect QtMaterialToggleRippleOverlay::overlayGeometry() const * \internal */ -QtMaterialToggleThumb::QtMaterialToggleThumb(QtMaterialToggle *parent) +ToggleThumb::ToggleThumb(Toggle *parent) : QWidget(parent), m_toggle(parent), m_shift(0), @@ -98,11 +100,11 @@ QtMaterialToggleThumb::QtMaterialToggleThumb(QtMaterialToggle *parent) parent->installEventFilter(this); } -QtMaterialToggleThumb::~QtMaterialToggleThumb() +ToggleThumb::~ToggleThumb() { } -void QtMaterialToggleThumb::setShift(qreal shift) +void ToggleThumb::setShift(qreal shift) { if (m_shift == shift) { return; @@ -112,7 +114,7 @@ void QtMaterialToggleThumb::setShift(qreal shift) updateOffset(); } -bool QtMaterialToggleThumb::eventFilter(QObject *obj, QEvent *event) +bool ToggleThumb::eventFilter(QObject *obj, QEvent *event) { const QEvent::Type type = event->type(); @@ -124,7 +126,7 @@ bool QtMaterialToggleThumb::eventFilter(QObject *obj, QEvent *event) return QWidget::eventFilter(obj, event); } -void QtMaterialToggleThumb::paintEvent(QPaintEvent *event) +void ToggleThumb::paintEvent(QPaintEvent *event) { Q_UNUSED(event) @@ -158,7 +160,7 @@ void QtMaterialToggleThumb::paintEvent(QPaintEvent *event) } } -void QtMaterialToggleThumb::updateOffset() +void ToggleThumb::updateOffset() { const QSize s(Qt::Horizontal == m_toggle->orientation() ? size() : size().transposed()); @@ -171,7 +173,7 @@ void QtMaterialToggleThumb::updateOffset() * \internal */ -QtMaterialToggleTrack::QtMaterialToggleTrack(QtMaterialToggle *parent) +ToggleTrack::ToggleTrack(Toggle *parent) : QWidget(parent), m_toggle(parent) { @@ -180,17 +182,17 @@ QtMaterialToggleTrack::QtMaterialToggleTrack(QtMaterialToggle *parent) parent->installEventFilter(this); } -QtMaterialToggleTrack::~QtMaterialToggleTrack() +ToggleTrack::~ToggleTrack() { } -void QtMaterialToggleTrack::setTrackColor(const QColor &color) +void ToggleTrack::setTrackColor(const QColor &color) { m_trackColor = color; update(); } -bool QtMaterialToggleTrack::eventFilter(QObject *obj, QEvent *event) +bool ToggleTrack::eventFilter(QObject *obj, QEvent *event) { const QEvent::Type type = event->type(); @@ -200,7 +202,7 @@ bool QtMaterialToggleTrack::eventFilter(QObject *obj, QEvent *event) return QWidget::eventFilter(obj, event); } -void QtMaterialToggleTrack::paintEvent(QPaintEvent *event) +void ToggleTrack::paintEvent(QPaintEvent *event) { Q_UNUSED(event) @@ -229,3 +231,4 @@ void QtMaterialToggleTrack::paintEvent(QPaintEvent *event) painter.drawRoundedRect(r.adjusted(4, 14, -4, -14), w/2-4, w/2-4); } } +} diff --git a/components/qtmaterialtoggle_internal.h b/components/qtmaterialtoggle_internal.h index 079e36990..6fb084db2 100644 --- a/components/qtmaterialtoggle_internal.h +++ b/components/qtmaterialtoggle_internal.h @@ -3,20 +3,22 @@ #include #include "lib/qtmaterialrippleoverlay.h" +namespace md +{ -class QtMaterialToggle; -class QtMaterialToggleThumb; -class QtMaterialToggleTrack; +class Toggle; +class ToggleThumb; +class ToggleTrack; -class QtMaterialToggleRippleOverlay : public QtMaterialRippleOverlay +class ToggleRippleOverlay : public RippleOverlay { Q_OBJECT public: - QtMaterialToggleRippleOverlay(QtMaterialToggleThumb *thumb, - QtMaterialToggleTrack *track, - QtMaterialToggle *parent); - ~QtMaterialToggleRippleOverlay(); + ToggleRippleOverlay(ToggleThumb *thumb, + ToggleTrack *track, + Toggle *parent); + ~ToggleRippleOverlay(); protected slots: void addToggleRipple(); @@ -26,14 +28,14 @@ protected slots: QRect overlayGeometry() const Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(QtMaterialToggleRippleOverlay) + Q_DISABLE_COPY(ToggleRippleOverlay) - QtMaterialToggle *const m_toggle; - QtMaterialToggleThumb *const m_thumb; - QtMaterialToggleTrack *const m_track; + Toggle *const m_toggle; + ToggleThumb *const m_thumb; + ToggleTrack *const m_track; }; -class QtMaterialToggleThumb : public QWidget +class ToggleThumb : public QWidget { Q_OBJECT @@ -41,8 +43,8 @@ class QtMaterialToggleThumb : public QWidget Q_PROPERTY(QColor thumbColor WRITE setThumbColor READ thumbColor) public: - QtMaterialToggleThumb(QtMaterialToggle *parent); - ~QtMaterialToggleThumb(); + ToggleThumb(Toggle *parent); + ~ToggleThumb(); void setShift(qreal shift); inline qreal shift() const; @@ -57,46 +59,46 @@ class QtMaterialToggleThumb : public QWidget void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(QtMaterialToggleThumb) + Q_DISABLE_COPY(ToggleThumb) void updateOffset(); - QtMaterialToggle *const m_toggle; + Toggle *const m_toggle; QColor m_thumbColor; qreal m_shift; qreal m_offset; }; -inline qreal QtMaterialToggleThumb::shift() const +inline qreal ToggleThumb::shift() const { return m_shift; } -inline qreal QtMaterialToggleThumb::offset() const +inline qreal ToggleThumb::offset() const { return m_offset; } -inline void QtMaterialToggleThumb::setThumbColor(const QColor &color) +inline void ToggleThumb::setThumbColor(const QColor &color) { m_thumbColor = color; update(); } -inline QColor QtMaterialToggleThumb::thumbColor() const +inline QColor ToggleThumb::thumbColor() const { return m_thumbColor; } -class QtMaterialToggleTrack : public QWidget +class ToggleTrack : public QWidget { Q_OBJECT Q_PROPERTY(QColor trackColor WRITE setTrackColor READ trackColor) public: - QtMaterialToggleTrack(QtMaterialToggle *parent); - ~QtMaterialToggleTrack(); + ToggleTrack(Toggle *parent); + ~ToggleTrack(); void setTrackColor(const QColor &color); inline QColor trackColor() const; @@ -106,15 +108,15 @@ class QtMaterialToggleTrack : public QWidget void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(QtMaterialToggleTrack) + Q_DISABLE_COPY(ToggleTrack) - QtMaterialToggle *const m_toggle; + Toggle *const m_toggle; QColor m_trackColor; }; -inline QColor QtMaterialToggleTrack::trackColor() const +inline QColor ToggleTrack::trackColor() const { return m_trackColor; } - +} #endif // QTMATERIALTOGGLE_INTERNAL_H diff --git a/components/qtmaterialtoggle_p.h b/components/qtmaterialtoggle_p.h index f50d5b35b..4b7196d2c 100644 --- a/components/qtmaterialtoggle_p.h +++ b/components/qtmaterialtoggle_p.h @@ -2,31 +2,33 @@ #define QTMATERIALTOGGLE_P_H #include +namespace md +{ class QStateMachine; class QState; class QColor; -class QtMaterialToggle; -class QtMaterialToggleTrack; -class QtMaterialToggleThumb; -class QtMaterialToggleRippleOverlay; +class Toggle; +class ToggleTrack; +class ToggleThumb; +class ToggleRippleOverlay; -class QtMaterialTogglePrivate +class TogglePrivate { - Q_DISABLE_COPY(QtMaterialTogglePrivate) - Q_DECLARE_PUBLIC(QtMaterialToggle) + Q_DISABLE_COPY(TogglePrivate) + Q_DECLARE_PUBLIC(Toggle) public: - QtMaterialTogglePrivate(QtMaterialToggle *q); - ~QtMaterialTogglePrivate(); + TogglePrivate(Toggle *q); + ~TogglePrivate(); void init(); void setupProperties(); - QtMaterialToggle *const q_ptr; - QtMaterialToggleTrack *track; - QtMaterialToggleThumb *thumb; - QtMaterialToggleRippleOverlay *rippleOverlay; + Toggle *const q_ptr; + ToggleTrack *track; + ToggleThumb *thumb; + ToggleRippleOverlay *rippleOverlay; QStateMachine *stateMachine; QState *offState; QState *onState; @@ -37,5 +39,5 @@ class QtMaterialTogglePrivate QColor trackColor; bool useThemeColors; }; - +} #endif // QTMATERIALTOGGLE_P_H From 0c7dc7544dd8d97d4f77114de115c5aea3e7e71f Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 04:15:43 +0100 Subject: [PATCH 29/46] "QtMaterialStyle" renamed to "Style" and moved to "md" namespace. --- components/qtmaterialappbar.cpp | 4 ++-- components/qtmaterialautocomplete.cpp | 10 ++++----- components/qtmaterialavatar.cpp | 6 +++--- components/qtmaterialcircularprogress.cpp | 4 ++-- components/qtmaterialflatbutton.cpp | 22 ++++++++++---------- components/qtmaterialflatbutton_internal.cpp | 14 ++++++------- components/qtmaterialiconbutton.cpp | 6 +++--- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/components/qtmaterialappbar.cpp b/components/qtmaterialappbar.cpp index ac625abfd..a93a6f35a 100644 --- a/components/qtmaterialappbar.cpp +++ b/components/qtmaterialappbar.cpp @@ -110,7 +110,7 @@ QColor AppBar::foregroundColor() const Q_D(const AppBar); if (d->useThemeColors || !d->foregroundColor.isValid()) { - return QtMaterialStyle::instance().themeColor("primary1"); + return Style::instance().themeColor("primary1"); } else { return d->foregroundColor; } @@ -133,7 +133,7 @@ QColor AppBar::backgroundColor() const Q_D(const AppBar); if (d->useThemeColors || !d->backgroundColor.isValid()) { - return QtMaterialStyle::instance().themeColor("primary1"); + return Style::instance().themeColor("primary1"); } else { return d->backgroundColor; } diff --git a/components/qtmaterialautocomplete.cpp b/components/qtmaterialautocomplete.cpp index e14f242ae..62ac90dc1 100644 --- a/components/qtmaterialautocomplete.cpp +++ b/components/qtmaterialautocomplete.cpp @@ -113,7 +113,7 @@ void AutoComplete::updateResults(QString text) if (diff > 0) { for (int c = 0; c < diff; c++) { - QtMaterialFlatButton *item = new QtMaterialFlatButton; + FlatButton *item = new FlatButton; item->setFont(font); item->setTextAlignment(Qt::AlignLeft); item->setCornerRadius(0); @@ -138,8 +138,8 @@ void AutoComplete::updateResults(QString text) for (int i = 0; i < results.count(); ++i) { QWidget *widget = d->menuLayout->itemAt(i)->widget(); - QtMaterialFlatButton *item; - if ((item = static_cast(widget))) { + FlatButton *item; + if ((item = static_cast(widget))) { QString text = results.at(i); QRect rect = fm->boundingRect(text); d->maxWidth = qMax(d->maxWidth, rect.width()); @@ -228,8 +228,8 @@ bool AutoComplete::eventFilter(QObject *watched, QEvent *event) { case QEvent::MouseButtonPress: { emit d->stateMachine->shouldFade(); - QtMaterialFlatButton *widget; - if ((widget = static_cast(watched))) { + FlatButton *widget; + if ((widget = static_cast(watched))) { QString text(widget->text()); setText(text); emit itemSelected(text); diff --git a/components/qtmaterialavatar.cpp b/components/qtmaterialavatar.cpp index ab8c38d1a..56578dc19 100644 --- a/components/qtmaterialavatar.cpp +++ b/components/qtmaterialavatar.cpp @@ -122,7 +122,7 @@ QColor Avatar::textColor() const Q_D(const Avatar); if (d->useThemeColors || !d->textColor.isValid()) { - return QtMaterialStyle::instance().themeColor("canvas"); + return Style::instance().themeColor("canvas"); } else { return d->textColor; } @@ -143,7 +143,7 @@ QColor Avatar::backgroundColor() const Q_D(const Avatar); if (d->useThemeColors || !d->backgroundColor.isValid()) { - return QtMaterialStyle::instance().themeColor("primary1"); + return Style::instance().themeColor("primary1"); } else { return d->backgroundColor; } @@ -242,7 +242,7 @@ void Avatar::paintEvent(QPaintEvent *event) { QBrush brush; brush.setStyle(Qt::SolidPattern); - brush.setColor(QtMaterialStyle::instance().themeColor("disabled")); + brush.setColor(Style::instance().themeColor("disabled")); painter.setPen(Qt::NoPen); painter.setBrush(brush); painter.drawEllipse(QRectF((width()-d->size)/2, (height()-d->size)/2, diff --git a/components/qtmaterialcircularprogress.cpp b/components/qtmaterialcircularprogress.cpp index 641a2dfb9..6718756c1 100644 --- a/components/qtmaterialcircularprogress.cpp +++ b/components/qtmaterialcircularprogress.cpp @@ -176,7 +176,7 @@ QColor CircularProgress::color() const Q_D(const CircularProgress); if (d->useThemeColors || !d->color.isValid()) { - return QtMaterialStyle::instance().themeColor("primary1"); + return Style::instance().themeColor("primary1"); } else { return d->color; } @@ -210,7 +210,7 @@ void CircularProgress::paintEvent(QPaintEvent *event) QPen pen; pen.setCapStyle(Qt::RoundCap); pen.setWidthF(d->penWidth); - pen.setColor(QtMaterialStyle::instance().themeColor("border")); + pen.setColor(Style::instance().themeColor("border")); painter.setPen(pen); painter.drawLine(rect().center()-QPointF(20, 20), rect().center()+QPointF(20, 20)); painter.drawLine(rect().center()+QPointF(20, -20), rect().center()-QPointF(20, -20)); diff --git a/components/qtmaterialflatbutton.cpp b/components/qtmaterialflatbutton.cpp index b892aaa96..0c1b1c691 100644 --- a/components/qtmaterialflatbutton.cpp +++ b/components/qtmaterialflatbutton.cpp @@ -56,7 +56,7 @@ void FlatButtonPrivate::init() useFixedRippleRadius = false; haloVisible = true; - q->setStyle(&QtMaterialStyle::instance()); + q->setStyle(&Style::instance()); q->setAttribute(Qt::WA_Hover); q->setMouseTracking(true); @@ -177,17 +177,17 @@ QColor FlatButton::foregroundColor() const if (d->useThemeColors || !d->foregroundColor.isValid()) { if (Qt::OpaqueMode == d->bgMode) { - return QtMaterialStyle::instance().themeColor("canvas"); + return Style::instance().themeColor("canvas"); } switch (d->role) { case Material::Primary: - return QtMaterialStyle::instance().themeColor("primary1"); + return Style::instance().themeColor("primary1"); case Material::Secondary: - return QtMaterialStyle::instance().themeColor("accent1"); + return Style::instance().themeColor("accent1"); case Material::Default: default: - return QtMaterialStyle::instance().themeColor("text"); + return Style::instance().themeColor("text"); } } return d->foregroundColor; @@ -212,12 +212,12 @@ QColor FlatButton::backgroundColor() const switch (d->role) { case Material::Primary: - return QtMaterialStyle::instance().themeColor("primary1"); + return Style::instance().themeColor("primary1"); case Material::Secondary: - return QtMaterialStyle::instance().themeColor("accent1"); + return Style::instance().themeColor("accent1"); case Material::Default: default: - return QtMaterialStyle::instance().themeColor("text"); + return Style::instance().themeColor("text"); } } return d->backgroundColor; @@ -260,7 +260,7 @@ QColor FlatButton::disabledForegroundColor() const Q_D(const FlatButton); if (d->useThemeColors || !d->disabledColor.isValid()) { - return QtMaterialStyle::instance().themeColor("disabled"); + return Style::instance().themeColor("disabled"); } else { return d->disabledColor; } @@ -281,7 +281,7 @@ QColor FlatButton::disabledBackgroundColor() const Q_D(const FlatButton); if (d->useThemeColors || !d->disabledBackgroundColor.isValid()) { - return QtMaterialStyle::instance().themeColor("disabled3"); + return Style::instance().themeColor("disabled3"); } else { return d->disabledBackgroundColor; } @@ -520,7 +520,7 @@ void FlatButton::mousePressEvent(QMouseEvent *event) radiusEndValue = static_cast(width())/2; } - QtMaterialRipple *ripple = new QtMaterialRipple(pos); + Ripple *ripple = new Ripple(pos); ripple->setRadiusEndValue(radiusEndValue); ripple->setOpacityStartValue(0.35); diff --git a/components/qtmaterialflatbutton_internal.cpp b/components/qtmaterialflatbutton_internal.cpp index f9ceef317..8591ba8bc 100644 --- a/components/qtmaterialflatbutton_internal.cpp +++ b/components/qtmaterialflatbutton_internal.cpp @@ -44,10 +44,10 @@ FlatButtonStateMachine::FlatButtonStateMachine(FlatButton *parent) m_checkableState->setInitialState(parent->isChecked() ? m_checkedState : m_uncheckedState); - QtMaterialStateTransition *transition; + StateTransition *transition; QPropertyAnimation *animation; - transition = new QtMaterialStateTransition(FlatButtonCheckedTransition); + transition = new StateTransition(FlatButtonCheckedTransition); transition->setTargetState(m_checkedState); m_uncheckedState->addTransition(transition); @@ -55,7 +55,7 @@ FlatButtonStateMachine::FlatButtonStateMachine(FlatButton *parent) animation->setDuration(200); transition->addAnimation(animation); - transition = new QtMaterialStateTransition(FlatButtonUncheckedTransition); + transition = new StateTransition(FlatButtonUncheckedTransition); transition->setTargetState(m_uncheckedState); m_checkedState->addTransition(transition); @@ -72,7 +72,7 @@ FlatButtonStateMachine::FlatButtonStateMachine(FlatButton *parent) addTransition(m_button, QEvent::FocusIn, m_hoveredState, m_hoveredFocusedState); addTransition(m_button, QEvent::FocusOut, m_hoveredFocusedState, m_hoveredState); - transition = new QtMaterialStateTransition(FlatButtonPressedTransition); + transition = new StateTransition(FlatButtonPressedTransition); transition->setTargetState(m_pressedState); m_hoveredState->addTransition(transition); @@ -181,9 +181,9 @@ void FlatButtonStateMachine::updateCheckedStatus() if (m_wasChecked != checked) { m_wasChecked = checked; if (checked) { - postEvent(new QtMaterialStateTransitionEvent(FlatButtonCheckedTransition)); + postEvent(new StateTransitionEvent(FlatButtonCheckedTransition)); } else { - postEvent(new QtMaterialStateTransitionEvent(FlatButtonUncheckedTransition)); + postEvent(new StateTransitionEvent(FlatButtonUncheckedTransition)); } } } @@ -194,7 +194,7 @@ bool FlatButtonStateMachine::eventFilter(QObject *watched, if (QEvent::FocusIn == event->type()) { QFocusEvent *focusEvent = static_cast(event); if (focusEvent && Qt::MouseFocusReason == focusEvent->reason()) { - postEvent(new QtMaterialStateTransitionEvent(FlatButtonPressedTransition)); + postEvent(new StateTransitionEvent(FlatButtonPressedTransition)); return true; } } diff --git a/components/qtmaterialiconbutton.cpp b/components/qtmaterialiconbutton.cpp index 9fbe4572a..e86f55319 100644 --- a/components/qtmaterialiconbutton.cpp +++ b/components/qtmaterialiconbutton.cpp @@ -30,7 +30,7 @@ void IconButtonPrivate::init() rippleOverlay->installEventFilter(q); - q->setStyle(&QtMaterialStyle::instance()); + q->setStyle(&Style::instance()); QSizePolicy policy; policy.setWidthForHeight(true); @@ -106,7 +106,7 @@ QColor IconButton::color() const Q_D(const IconButton); if (d->useThemeColors || !d->color.isValid()) { - return QtMaterialStyle::instance().themeColor("text"); + return Style::instance().themeColor("text"); } return d->color; } @@ -126,7 +126,7 @@ QColor IconButton::disabledColor() const Q_D(const IconButton); if (d->useThemeColors || !d->disabledColor.isValid()) { - return QtMaterialStyle::instance().themeColor("disabled"); + return Style::instance().themeColor("disabled"); } return d->disabledColor; } From a9281b2a4284b32074753f764a600511d37856b3 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 04:17:31 +0100 Subject: [PATCH 30/46] Importing StateMachine Module. --- components/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index a5b77b0d6..34d2d12f9 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -15,6 +15,7 @@ find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core5Compat REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS StateMachine REQUIRED) set(PROJECT_SOURCES qtmaterialavatar.cpp @@ -169,6 +170,7 @@ endif() target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::Core) target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::Core5Compat) +target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::StateMachine) set_target_properties(components PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com From 0a6c3373ca05b3f5ea74c5db3cedb66a2611fe84 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 12:03:24 +0100 Subject: [PATCH 31/46] Fixing structure of the project *Root Project |=> shared library called 'components'. |=> executable 'examples'. --- CMakeLists.txt | 39 ++++++----- components/CMakeLists.txt | 24 +++---- examples/CMakeLists.txt | 138 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 171 insertions(+), 30 deletions(-) create mode 100644 examples/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index c7aef909b..c6d4c75ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,21 +12,23 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED) -find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Gui REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core5Compat REQUIRED) add_subdirectory(components) +add_subdirectory(examples) -set(PROJECT_SOURCES +#set(PROJECT_SOURCES -) +#) if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) - qt_add_executable(QtMaterialWidgets - MANUAL_FINALIZATION - ${PROJECT_SOURCES} - ) +# qt_add_executable(QtMaterialWidgets +# MANUAL_FINALIZATION +# ${PROJECT_SOURCES} +# ) # Define target properties for Android with Qt 6 as: # set_property(TARGET QtMaterialWidgets APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR # ${CMAKE_CURRENT_SOURCE_DIR}/android) @@ -45,20 +47,21 @@ else() endif() endif() -target_link_libraries(QtMaterialWidgets PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) -target_link_libraries(QtMaterialWidgets PRIVATE Qt${QT_VERSION_MAJOR}::Core) -target_link_libraries(QtMaterialWidgets PRIVATE Qt${QT_VERSION_MAJOR}::Core5Compat) +#target_link_libraries(QtMaterialWidgets PRIVATE Qt${QT_VERSION_MAJOR}::Core) +#target_link_libraries(QtMaterialWidgets PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) +#target_link_libraries(QtMaterialWidgets PRIVATE Qt${QT_VERSION_MAJOR}::Core5Compat) + -set_target_properties(QtMaterialWidgets PROPERTIES - MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com - MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} - MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} - MACOSX_BUNDLE TRUE - WIN32_EXECUTABLE TRUE -) +#set_target_properties(QtMaterialWidgets PROPERTIES +# MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com +# MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} +# MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} +# MACOSX_BUNDLE TRUE +# WIN32_EXECUTABLE TRUE +#) #file(COPY assets DESTINATION ${CMAKE_BINARY_DIR}) if(QT_VERSION_MAJOR EQUAL 6) - qt_finalize_executable(QtMaterialWidgets) +# qt_finalize_executable(QtMaterialWidgets) endif() diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 34d2d12f9..37d1137bd 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.5) -project(components VERSION 0.1 LANGUAGES CXX) +#project(components VERSION 0.1 LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -17,6 +17,8 @@ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core5Compat REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS StateMachine REQUIRED) +# Create a library called "components" which includes the source file "*.cpp". +# The extension is already found. Any number of sources could be listed here. set(PROJECT_SOURCES qtmaterialavatar.cpp lib/qtmaterialstyle.cpp @@ -145,25 +147,18 @@ set(PROJECT_SOURCES ) if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) - qt_add_executable(components - MANUAL_FINALIZATION - ${PROJECT_SOURCES} - ) + add_library(components SHARED ${PROJECT_SOURCES}) # Define target properties for Android with Qt 6 as: # set_property(TARGET components APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR # ${CMAKE_CURRENT_SOURCE_DIR}/android) # For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation else() if(ANDROID) - add_library(components SHARED - ${PROJECT_SOURCES} - ) + add_library(components SHARED ${PROJECT_SOURCES}) # Define properties for Android with Qt 5 after find_package() calls as: # set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android") else() - add_executable(components - ${PROJECT_SOURCES} - ) +# add_executable(components ${PROJECT_SOURCES}) endif() endif() @@ -172,6 +167,11 @@ target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::Core) target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::Core5Compat) target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::StateMachine) +# Make sure the compiler can find include files for our components library +# when other libraries or executables link to components +target_include_directories (components PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + + set_target_properties(components PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} @@ -183,5 +183,5 @@ set_target_properties(components PROPERTIES file(COPY icons DESTINATION ${CMAKE_BINARY_DIR}) if(QT_VERSION_MAJOR EQUAL 6) - qt_finalize_executable(components) +# qt_finalize_executable(components) endif() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 000000000..eb452fb27 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,138 @@ +cmake_minimum_required(VERSION 3.5) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Gui REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core5Compat REQUIRED) + +# Add executable called "examples" that is built from the source files +# "*.cpp". The extensions are automatically found. +# add_executable (examples) + +set(PROJECT_SOURCES + #sources + main.cpp + mainwindow.cpp + avatarsettingseditor.cpp + badgesettingseditor.cpp + checkboxsettingseditor.cpp + fabsettingseditor.cpp + raisedbuttonsettingseditor.cpp + flatbuttonsettingseditor.cpp + iconbuttonsettingseditor.cpp + progresssettingseditor.cpp + circularprogresssettingseditor.cpp + slidersettingseditor.cpp + radiobuttonsettingseditor.cpp + togglesettingseditor.cpp + textfieldsettingseditor.cpp + tabssettingseditor.cpp + snackbarsettingseditor.cpp + dialogsettingseditor.cpp + drawersettingseditor.cpp + scrollbarsettingseditor.cpp + appbarsettingseditor.cpp + autocompletesettingseditor.cpp + menusettingseditor.cpp + # Headers + mainwindow.h + avatarsettingseditor.h + badgesettingseditor.h + checkboxsettingseditor.h + fabsettingseditor.h + raisedbuttonsettingseditor.h + flatbuttonsettingseditor.h + iconbuttonsettingseditor.h + progresssettingseditor.h + circularprogresssettingseditor.h + slidersettingseditor.h + radiobuttonsettingseditor.h + togglesettingseditor.h + textfieldsettingseditor.h + tabssettingseditor.h + snackbarsettingseditor.h + dialogsettingseditor.h + drawersettingseditor.h + scrollbarsettingseditor.h + appbarsettingseditor.h + autocompletesettingseditor.h + menusettingseditor.h + # Forms + avatarsettingsform.ui + badgesettingsform.ui + checkboxsettingsform.ui + fabsettingsform.ui + flatbuttonsettingsform.ui + iconbuttonsettingsform.ui + progresssettingsform.ui + circularprogresssettingsform.ui + slidersettingsform.ui + snackbarsettingsform.ui + radiobuttonsettingsform.ui + togglesettingsform.ui + textfieldsettingsform.ui + tabssettingsform.ui + dialogsettingsform.ui + drawersettingsform.ui + scrollbarsettingsform.ui + appbarsettingsform.ui +) + +if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) + qt_add_executable(examples + MANUAL_FINALIZATION + ${PROJECT_SOURCES} + ) +# Define target properties for Android with Qt 6 as: +# set_property(TARGET examples APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR +# ${CMAKE_CURRENT_SOURCE_DIR}/android) +# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation +else() + if(ANDROID) + add_library(examples SHARED + ${PROJECT_SOURCES} + ) +# Define properties for Android with Qt 5 after find_package() calls as: +# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android") + else() + add_executable(examples + ${PROJECT_SOURCES} + ) + endif() +endif() + +target_link_libraries(examples PRIVATE Qt${QT_VERSION_MAJOR}::Core) +target_link_libraries(examples PRIVATE Qt${QT_VERSION_MAJOR}::Gui) +target_link_libraries(examples PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) +target_link_libraries(examples PRIVATE Qt${QT_VERSION_MAJOR}::Core5Compat) + + +# Link the executable to the 'components' library. Since the 'components' library has +# public include directories we will use those link directories when building +# examples +target_link_libraries(examples LINK_PUBLIC components) + + +set_target_properties(examples PROPERTIES + MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com + MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} + MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} + MACOSX_BUNDLE TRUE + WIN32_EXECUTABLE TRUE +) + +file(COPY assets DESTINATION ${CMAKE_BINARY_DIR}) + +if(QT_VERSION_MAJOR EQUAL 6) + qt_finalize_executable(examples) +endif() From b209855d0dc8ac2692f632fccd4fb1c9fc1d4adf Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 12:04:04 +0100 Subject: [PATCH 32/46] Remove the support of qmake --- examples/examples.pro | 75 ------------------------------------------- examples/examples.qrc | 6 ---- 2 files changed, 81 deletions(-) delete mode 100644 examples/examples.pro delete mode 100644 examples/examples.qrc diff --git a/examples/examples.pro b/examples/examples.pro deleted file mode 100644 index 35d2438ca..000000000 --- a/examples/examples.pro +++ /dev/null @@ -1,75 +0,0 @@ -QT += core gui widgets -TEMPLATE = app -CONFIG += c++11 -SOURCES = mainwindow.cpp \ - main.cpp \ - avatarsettingseditor.cpp \ - badgesettingseditor.cpp \ - checkboxsettingseditor.cpp \ - fabsettingseditor.cpp \ - raisedbuttonsettingseditor.cpp \ - flatbuttonsettingseditor.cpp \ - iconbuttonsettingseditor.cpp \ - progresssettingseditor.cpp \ - circularprogresssettingseditor.cpp \ - slidersettingseditor.cpp \ - radiobuttonsettingseditor.cpp \ - togglesettingseditor.cpp \ - textfieldsettingseditor.cpp \ - tabssettingseditor.cpp \ - snackbarsettingseditor.cpp \ - dialogsettingseditor.cpp \ - drawersettingseditor.cpp \ - scrollbarsettingseditor.cpp \ - appbarsettingseditor.cpp \ - autocompletesettingseditor.cpp \ - menusettingseditor.cpp -HEADERS = mainwindow.h \ - avatarsettingseditor.h \ - badgesettingseditor.h \ - checkboxsettingseditor.h \ - fabsettingseditor.h \ - raisedbuttonsettingseditor.h \ - flatbuttonsettingseditor.h \ - iconbuttonsettingseditor.h \ - progresssettingseditor.h \ - circularprogresssettingseditor.h \ - slidersettingseditor.h \ - radiobuttonsettingseditor.h \ - togglesettingseditor.h \ - textfieldsettingseditor.h \ - tabssettingseditor.h \ - snackbarsettingseditor.h \ - dialogsettingseditor.h \ - drawersettingseditor.h \ - scrollbarsettingseditor.h \ - appbarsettingseditor.h \ - autocompletesettingseditor.h \ - menusettingseditor.h -LIBS += $$top_builddir/components/$(OBJECTS_DIR)/libcomponents.a -INCLUDEPATH += $$top_srcdir/components/ -TARGET = examples-exe -PRE_TARGETDEPS += $$top_builddir/components/$(OBJECTS_DIR)/libcomponents.a - -RESOURCES += \ - examples.qrc - -FORMS += \ - avatarsettingsform.ui \ - badgesettingsform.ui \ - checkboxsettingsform.ui \ - fabsettingsform.ui \ - flatbuttonsettingsform.ui \ - iconbuttonsettingsform.ui \ - progresssettingsform.ui \ - circularprogresssettingsform.ui \ - slidersettingsform.ui \ - snackbarsettingsform.ui \ - radiobuttonsettingsform.ui \ - togglesettingsform.ui \ - textfieldsettingsform.ui \ - tabssettingsform.ui \ - dialogsettingsform.ui \ - drawersettingsform.ui \ - scrollbarsettingsform.ui \ - appbarsettingsform.ui diff --git a/examples/examples.qrc b/examples/examples.qrc deleted file mode 100644 index e6bff79b1..000000000 --- a/examples/examples.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - assets/uxceo-128.jpg - assets/sikh.jpg - - From 08e07038f332c87d9017cb07f295189241a87e37 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 12:06:23 +0100 Subject: [PATCH 33/46] Customizing a test example. --- examples/avatarsettingseditor.cpp | 7 +- examples/avatarsettingseditor.h | 9 +- examples/badgesettingseditor.cpp | 2 +- examples/badgesettingseditor.h | 4 +- examples/main.cpp | 4 +- examples/mainwindow.cpp | 145 +++++++++++++----------------- examples/mainwindow.h | 25 ++++++ 7 files changed, 99 insertions(+), 97 deletions(-) diff --git a/examples/avatarsettingseditor.cpp b/examples/avatarsettingseditor.cpp index 17204802f..2ae95ce17 100644 --- a/examples/avatarsettingseditor.cpp +++ b/examples/avatarsettingseditor.cpp @@ -1,12 +1,9 @@ #include "avatarsettingseditor.h" -#include -#include -#include AvatarSettingsEditor::AvatarSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::AvatarSettingsForm), - m_avatar(new QtMaterialAvatar(QChar('X'))) + m_avatar(new Avatar(QChar('X'))) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); @@ -76,7 +73,7 @@ void AvatarSettingsEditor::updateWidget() m_avatar->setImage(QImage(":/images/assets/sikh.jpg")); break; case 2: - m_avatar->setIcon(QtMaterialTheme::icon("communication", "message")); + m_avatar->setIcon(Theme::icon("communication", "message")); break; default: break; diff --git a/examples/avatarsettingseditor.h b/examples/avatarsettingseditor.h index c9bc00956..6485fa0fd 100644 --- a/examples/avatarsettingseditor.h +++ b/examples/avatarsettingseditor.h @@ -2,9 +2,14 @@ #define AVATARSETTINGSEDITOR_H #include + +#include +#include +#include #include "ui_avatarsettingsform.h" -class QtMaterialAvatar; +using namespace md; +//class Avatar; class AvatarSettingsEditor : public QWidget { @@ -21,7 +26,7 @@ protected slots: private: Ui::AvatarSettingsForm *const ui; - QtMaterialAvatar *const m_avatar; + Avatar *const m_avatar; }; #endif // AVATARSETTINGSEDITOR_H diff --git a/examples/badgesettingseditor.cpp b/examples/badgesettingseditor.cpp index 4b5214682..9e70d7b55 100644 --- a/examples/badgesettingseditor.cpp +++ b/examples/badgesettingseditor.cpp @@ -6,7 +6,7 @@ BadgeSettingsEditor::BadgeSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::BadgeSettingsForm), - m_avatar(new QtMaterialAvatar(QImage(":/images/assets/sikh.jpg"))), + m_avatar(new Avatar(QImage(":/images/assets/sikh.jpg"))), m_badge(new QtMaterialBadge) { QVBoxLayout *layout = new QVBoxLayout; diff --git a/examples/badgesettingseditor.h b/examples/badgesettingseditor.h index 8f748083b..531dfb26a 100644 --- a/examples/badgesettingseditor.h +++ b/examples/badgesettingseditor.h @@ -4,7 +4,7 @@ #include #include "ui_badgesettingsform.h" -class QtMaterialAvatar; +class Avatar; class QtMaterialBadge; class BadgeSettingsEditor : public QWidget @@ -22,7 +22,7 @@ protected slots: private: Ui::BadgeSettingsForm *const ui; - QtMaterialAvatar *const m_avatar; + Avatar *const m_avatar; QtMaterialBadge *const m_badge; }; diff --git a/examples/main.cpp b/examples/main.cpp index 38f87613e..95b0f6fd4 100644 --- a/examples/main.cpp +++ b/examples/main.cpp @@ -4,9 +4,7 @@ int main(int argc, char *argv[]) { - QApplication a(argc, argv); - - Q_INIT_RESOURCE(resources); + QApplication a(argc, argv); MainWindow window; window.show(); diff --git a/examples/mainwindow.cpp b/examples/mainwindow.cpp index cc4992e45..773a61d6c 100644 --- a/examples/mainwindow.cpp +++ b/examples/mainwindow.cpp @@ -1,28 +1,4 @@ #include "mainwindow.h" -#include -#include -#include -#include "avatarsettingseditor.h" -#include "badgesettingseditor.h" -#include "checkboxsettingseditor.h" -#include "fabsettingseditor.h" -#include "raisedbuttonsettingseditor.h" -#include "flatbuttonsettingseditor.h" -#include "iconbuttonsettingseditor.h" -#include "progresssettingseditor.h" -#include "circularprogresssettingseditor.h" -#include "slidersettingseditor.h" -#include "radiobuttonsettingseditor.h" -#include "togglesettingseditor.h" -#include "textfieldsettingseditor.h" -#include "tabssettingseditor.h" -#include "snackbarsettingseditor.h" -#include "dialogsettingseditor.h" -#include "drawersettingseditor.h" -#include "scrollbarsettingseditor.h" -#include "appbarsettingseditor.h" -#include "autocompletesettingseditor.h" -#include "menusettingseditor.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) @@ -43,70 +19,71 @@ MainWindow::MainWindow(QWidget *parent) setCentralWidget(widget); AvatarSettingsEditor *avatar = new AvatarSettingsEditor; - BadgeSettingsEditor *badge = new BadgeSettingsEditor; - CheckBoxSettingsEditor *checkbox = new CheckBoxSettingsEditor; - FloatingActionButtonSettingsEditor *fab = new FloatingActionButtonSettingsEditor; - RaisedButtonSettingsEditor *raisedButton = new RaisedButtonSettingsEditor; - FlatButtonSettingsEditor *flatButton = new FlatButtonSettingsEditor; - IconButtonSettingsEditor *iconButton = new IconButtonSettingsEditor; - ProgressSettingsEditor *progress = new ProgressSettingsEditor; - CircularProgressSettingsEditor *circularProgress = new CircularProgressSettingsEditor; - SliderSettingsEditor *slider = new SliderSettingsEditor; - RadioButtonSettingsEditor *radioButton = new RadioButtonSettingsEditor; - ToggleSettingsEditor *toggle = new ToggleSettingsEditor; - TextFieldSettingsEditor *textField = new TextFieldSettingsEditor; - TabsSettingsEditor *tabs = new TabsSettingsEditor; - SnackbarSettingsEditor *snackbar = new SnackbarSettingsEditor; - DialogSettingsEditor *dialog = new DialogSettingsEditor; - DrawerSettingsEditor *drawer = new DrawerSettingsEditor; - ScrollBarSettingsEditor *scrollBar = new ScrollBarSettingsEditor; - AppBarSettingsEditor *appBar = new AppBarSettingsEditor; - AutoCompleteSettingsEditor *autocomplete = new AutoCompleteSettingsEditor; - MenuSettingsEditor *menu = new MenuSettingsEditor; +// BadgeSettingsEditor *badge = new BadgeSettingsEditor; +// CheckBoxSettingsEditor *checkbox = new CheckBoxSettingsEditor; +// FloatingActionButtonSettingsEditor *fab = new FloatingActionButtonSettingsEditor; +// RaisedButtonSettingsEditor *raisedButton = new RaisedButtonSettingsEditor; +// FlatButtonSettingsEditor *flatButton = new FlatButtonSettingsEditor; +// IconButtonSettingsEditor *iconButton = new IconButtonSettingsEditor; +// ProgressSettingsEditor *progress = new ProgressSettingsEditor; +// CircularProgressSettingsEditor *circularProgress = new CircularProgressSettingsEditor; +// SliderSettingsEditor *slider = new SliderSettingsEditor; +// RadioButtonSettingsEditor *radioButton = new RadioButtonSettingsEditor; +// ToggleSettingsEditor *toggle = new ToggleSettingsEditor; +// TextFieldSettingsEditor *textField = new TextFieldSettingsEditor; +// TabsSettingsEditor *tabs = new TabsSettingsEditor; +// SnackbarSettingsEditor *snackbar = new SnackbarSettingsEditor; +// DialogSettingsEditor *dialog = new DialogSettingsEditor; +// DrawerSettingsEditor *drawer = new DrawerSettingsEditor; +// ScrollBarSettingsEditor *scrollBar = new ScrollBarSettingsEditor; +// AppBarSettingsEditor *appBar = new AppBarSettingsEditor; +// AutoCompleteSettingsEditor *autocomplete = new AutoCompleteSettingsEditor; +// MenuSettingsEditor *menu = new MenuSettingsEditor; - stack->addWidget(appBar); - stack->addWidget(autocomplete); stack->addWidget(avatar); - stack->addWidget(badge); - stack->addWidget(checkbox); - stack->addWidget(circularProgress); - stack->addWidget(dialog); - stack->addWidget(drawer); - stack->addWidget(fab); - stack->addWidget(flatButton); - stack->addWidget(iconButton); - stack->addWidget(menu); - stack->addWidget(progress); - stack->addWidget(radioButton); - stack->addWidget(raisedButton); - stack->addWidget(scrollBar); - stack->addWidget(slider); - stack->addWidget(snackbar); - stack->addWidget(tabs); - stack->addWidget(textField); - stack->addWidget(toggle); +// stack->addWidget(appBar); +// stack->addWidget(autocomplete); +// stack->addWidget(badge); +// stack->addWidget(checkbox); +// stack->addWidget(circularProgress); +// stack->addWidget(dialog); +// stack->addWidget(drawer); +// stack->addWidget(fab); +// stack->addWidget(flatButton); +// stack->addWidget(iconButton); +// stack->addWidget(menu); +// stack->addWidget(progress); +// stack->addWidget(radioButton); +// stack->addWidget(raisedButton); +// stack->addWidget(scrollBar); +// stack->addWidget(slider); +// stack->addWidget(snackbar); +// stack->addWidget(tabs); +// stack->addWidget(textField); +// stack->addWidget(toggle); + - list->addItem("App Bar"); - list->addItem("Auto Complete"); list->addItem("Avatar"); - list->addItem("Badge"); - list->addItem("Checkbox"); - list->addItem("Circular Progress"); - list->addItem("Dialog"); - list->addItem("Drawer"); - list->addItem("Floating Action Button"); - list->addItem("Flat Button"); - list->addItem("Icon Button"); - list->addItem("Menu"); - list->addItem("Progress"); - list->addItem("Radio Button"); - list->addItem("Raised Button"); - list->addItem("ScrollBar"); - list->addItem("Slider"); - list->addItem("Snackbar"); - list->addItem("Tabs"); - list->addItem("Text Field"); - list->addItem("Toggle"); +// list->addItem("App Bar"); +// list->addItem("Auto Complete"); +// list->addItem("Badge"); +// list->addItem("Checkbox"); +// list->addItem("Circular Progress"); +// list->addItem("Dialog"); +// list->addItem("Drawer"); +// list->addItem("Floating Action Button"); +// list->addItem("Flat Button"); +// list->addItem("Icon Button"); +// list->addItem("Menu"); +// list->addItem("Progress"); +// list->addItem("Radio Button"); +// list->addItem("Raised Button"); +// list->addItem("ScrollBar"); +// list->addItem("Slider"); +// list->addItem("Snackbar"); +// list->addItem("Tabs"); +// list->addItem("Text Field"); +// list->addItem("Toggle"); list->setCurrentRow(0); diff --git a/examples/mainwindow.h b/examples/mainwindow.h index 1f39a8c16..856795a74 100644 --- a/examples/mainwindow.h +++ b/examples/mainwindow.h @@ -2,6 +2,31 @@ #define MAINWINDOW_H #include +#include +#include +#include + +#include "avatarsettingseditor.h" +//#include "badgesettingseditor.h" +//#include "checkboxsettingseditor.h" +//#include "fabsettingseditor.h" +//#include "raisedbuttonsettingseditor.h" +//#include "flatbuttonsettingseditor.h" +//#include "iconbuttonsettingseditor.h" +//#include "progresssettingseditor.h" +//#include "circularprogresssettingseditor.h" +//#include "slidersettingseditor.h" +//#include "radiobuttonsettingseditor.h" +//#include "togglesettingseditor.h" +//#include "textfieldsettingseditor.h" +//#include "tabssettingseditor.h" +//#include "snackbarsettingseditor.h" +//#include "dialogsettingseditor.h" +//#include "drawersettingseditor.h" +//#include "scrollbarsettingseditor.h" +//#include "appbarsettingseditor.h" +//#include "autocompletesettingseditor.h" +//#include "menusettingseditor.h" class MainWindow : public QMainWindow { From 5a044e1220e4997e8ce4530fa0528faa7eca0776 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 13:16:54 +0100 Subject: [PATCH 34/46] Testing one component at a time. --- examples/CMakeLists.txt | 114 +++++++++++++------------- examples/iconbuttonsettingseditor.cpp | 4 +- 2 files changed, 59 insertions(+), 59 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index eb452fb27..dd11115ca 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -24,68 +24,68 @@ set(PROJECT_SOURCES main.cpp mainwindow.cpp avatarsettingseditor.cpp - badgesettingseditor.cpp - checkboxsettingseditor.cpp - fabsettingseditor.cpp - raisedbuttonsettingseditor.cpp - flatbuttonsettingseditor.cpp - iconbuttonsettingseditor.cpp - progresssettingseditor.cpp - circularprogresssettingseditor.cpp - slidersettingseditor.cpp - radiobuttonsettingseditor.cpp - togglesettingseditor.cpp - textfieldsettingseditor.cpp - tabssettingseditor.cpp - snackbarsettingseditor.cpp - dialogsettingseditor.cpp - drawersettingseditor.cpp - scrollbarsettingseditor.cpp - appbarsettingseditor.cpp - autocompletesettingseditor.cpp - menusettingseditor.cpp +# badgesettingseditor.cpp +# checkboxsettingseditor.cpp +# fabsettingseditor.cpp +# raisedbuttonsettingseditor.cpp +# flatbuttonsettingseditor.cpp +# iconbuttonsettingseditor.cpp +# progresssettingseditor.cpp +# circularprogresssettingseditor.cpp +# slidersettingseditor.cpp +# radiobuttonsettingseditor.cpp +# togglesettingseditor.cpp +# textfieldsettingseditor.cpp +# tabssettingseditor.cpp +# snackbarsettingseditor.cpp +# dialogsettingseditor.cpp +# drawersettingseditor.cpp +# scrollbarsettingseditor.cpp +# appbarsettingseditor.cpp +# autocompletesettingseditor.cpp +# menusettingseditor.cpp # Headers mainwindow.h avatarsettingseditor.h - badgesettingseditor.h - checkboxsettingseditor.h - fabsettingseditor.h - raisedbuttonsettingseditor.h - flatbuttonsettingseditor.h - iconbuttonsettingseditor.h - progresssettingseditor.h - circularprogresssettingseditor.h - slidersettingseditor.h - radiobuttonsettingseditor.h - togglesettingseditor.h - textfieldsettingseditor.h - tabssettingseditor.h - snackbarsettingseditor.h - dialogsettingseditor.h - drawersettingseditor.h - scrollbarsettingseditor.h - appbarsettingseditor.h - autocompletesettingseditor.h - menusettingseditor.h +# badgesettingseditor.h +# checkboxsettingseditor.h +# fabsettingseditor.h +# raisedbuttonsettingseditor.h +# flatbuttonsettingseditor.h +# iconbuttonsettingseditor.h +# progresssettingseditor.h +# circularprogresssettingseditor.h +# slidersettingseditor.h +# radiobuttonsettingseditor.h +# togglesettingseditor.h +# textfieldsettingseditor.h +# tabssettingseditor.h +# snackbarsettingseditor.h +# dialogsettingseditor.h +# drawersettingseditor.h +# scrollbarsettingseditor.h +# appbarsettingseditor.h +# autocompletesettingseditor.h +# menusettingseditor.h # Forms avatarsettingsform.ui - badgesettingsform.ui - checkboxsettingsform.ui - fabsettingsform.ui - flatbuttonsettingsform.ui - iconbuttonsettingsform.ui - progresssettingsform.ui - circularprogresssettingsform.ui - slidersettingsform.ui - snackbarsettingsform.ui - radiobuttonsettingsform.ui - togglesettingsform.ui - textfieldsettingsform.ui - tabssettingsform.ui - dialogsettingsform.ui - drawersettingsform.ui - scrollbarsettingsform.ui - appbarsettingsform.ui +# badgesettingsform.ui +# checkboxsettingsform.ui +# fabsettingsform.ui +# flatbuttonsettingsform.ui +# iconbuttonsettingsform.ui +# progresssettingsform.ui +# circularprogresssettingsform.ui +# slidersettingsform.ui +# snackbarsettingsform.ui +# radiobuttonsettingsform.ui +# togglesettingsform.ui +# textfieldsettingsform.ui +# tabssettingsform.ui +# dialogsettingsform.ui +# drawersettingsform.ui +# scrollbarsettingsform.ui +# appbarsettingsform.ui ) if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) diff --git a/examples/iconbuttonsettingseditor.cpp b/examples/iconbuttonsettingseditor.cpp index 4dbc51861..aba4bc1b8 100644 --- a/examples/iconbuttonsettingseditor.cpp +++ b/examples/iconbuttonsettingseditor.cpp @@ -6,7 +6,7 @@ IconButtonSettingsEditor::IconButtonSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::IconButtonSettingsForm), - m_button(new QtMaterialIconButton(QtMaterialTheme::icon("toggle", "star"))) + m_button(new QtMaterialIconButton(Theme::icon("toggle", "star"))) { init(); } @@ -16,7 +16,7 @@ IconButtonSettingsEditor::~IconButtonSettingsEditor() delete ui; } -IconButtonSettingsEditor::IconButtonSettingsEditor(QtMaterialIconButton *button, QWidget *parent) +IconButtonSettingsEditor::IconButtonSettingsEditor(IconButton *button, QWidget *parent) : QWidget(parent), ui(new Ui::IconButtonSettingsForm), m_button(button) From 4215a79689f8ee62802f94c7d58fe0213b9fcf15 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 13:21:27 +0100 Subject: [PATCH 35/46] Reorganizing and fix the headers/include. --- components/CMakeLists.txt | 6 +++--- components/lib/qtmaterialcheckable.cpp | 7 ------- components/lib/qtmaterialcheckable_p.h | 11 ++++++++--- components/qtmaterialautocomplete.cpp | 10 +--------- components/qtmaterialautocomplete_p.h | 12 ++++++++++-- components/qtmaterialcheckbox.cpp | 6 +----- components/qtmaterialcheckbox_p.h | 7 +++++++ components/qtmaterialdialog.cpp | 15 +++------------ components/qtmaterialdialog.h | 7 ++++++- components/qtmaterialdialog_internal.cpp | 6 +----- components/qtmaterialdialog_internal.h | 11 +++++++++-- components/qtmaterialdialog_p.h | 10 ++++++++-- components/qtmaterialdrawer.cpp | 11 +---------- components/qtmaterialdrawer.h | 12 ++++++++++++ components/qtmaterialflatbutton_internal.cpp | 6 ------ components/qtmaterialflatbutton_internal.h | 10 ++++++++-- components/qtmaterialiconbutton_p.h | 3 +-- components/qtmaterialprogress_internal.cpp | 3 +++ components/qtmaterialprogress_internal.h | 1 + components/qtmaterialradiobutton.cpp | 9 ++------- components/qtmaterialradiobutton.h | 3 +++ components/qtmaterialradiobutton_p.h | 7 +++++++ components/qtmaterialraisedbutton.cpp | 6 +----- components/qtmaterialraisedbutton.h | 1 + components/qtmaterialraisedbutton_p.h | 10 +++++++--- components/qtmaterialscrollbar.cpp | 7 +------ components/qtmaterialscrollbar.h | 8 ++++++++ components/qtmaterialscrollbar_internal.h | 5 ++++- components/qtmaterialscrollbar_p.h | 1 + components/qtmaterialslider.cpp | 1 + components/qtmaterialslider.h | 1 + components/qtmaterialslider_p.h | 1 + components/qtmaterialsnackbar.h | 1 + components/qtmaterialsnackbar_internal.h | 1 + components/qtmaterialsnackbar_p.h | 3 ++- components/qtmaterialtabs.cpp | 10 ++++------ components/qtmaterialtabs.h | 6 ++++++ components/qtmaterialtabs_internal.cpp | 8 +------- components/qtmaterialtabs_internal.h | 9 ++++++++- components/qtmaterialtabs_p.h | 4 +++- components/qtmaterialtextfield.h | 1 + components/qtmaterialtextfield_internal.cpp | 7 ++----- components/qtmaterialtextfield_internal.h | 8 ++++++-- components/qtmaterialtoggle.cpp | 6 ++---- components/qtmaterialtoggle.h | 1 + components/qtmaterialtoggle_internal.cpp | 5 ++--- components/qtmaterialtoggle_internal.h | 5 +++++ components/qtmaterialtoggle_p.h | 10 ++++++---- 48 files changed, 172 insertions(+), 127 deletions(-) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 37d1137bd..98869059a 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -44,7 +44,7 @@ set(PROJECT_SOURCES qtmaterialslider.cpp qtmaterialsnackbar_internal.cpp qtmaterialsnackbar.cpp - qtmaterialradiobutton.cpp +# qtmaterialradiobutton.cpp qtmaterialtoggle_internal.cpp qtmaterialtoggle.cpp qtmaterialtextfield_internal.cpp @@ -106,8 +106,8 @@ set(PROJECT_SOURCES qtmaterialsnackbar_internal.h qtmaterialsnackbar_p.h qtmaterialsnackbar.h - qtmaterialradiobutton_p.h - qtmaterialradiobutton.h +# qtmaterialradiobutton_p.h +# qtmaterialradiobutton.h qtmaterialtoggle_internal.h qtmaterialtoggle_p.h qtmaterialtoggle.h diff --git a/components/lib/qtmaterialcheckable.cpp b/components/lib/qtmaterialcheckable.cpp index 8a6f2507c..25ca9eb5b 100644 --- a/components/lib/qtmaterialcheckable.cpp +++ b/components/lib/qtmaterialcheckable.cpp @@ -1,12 +1,5 @@ #include "lib/qtmaterialcheckable.h" #include "lib/qtmaterialcheckable_p.h" -#include -#include -#include -#include -#include -#include -#include #include "lib/qtmaterialrippleoverlay.h" #include "lib/qtmaterialripple.h" #include "lib/qtmaterialstyle.h" diff --git a/components/lib/qtmaterialcheckable_p.h b/components/lib/qtmaterialcheckable_p.h index 57c4cf8e0..6d199703c 100644 --- a/components/lib/qtmaterialcheckable_p.h +++ b/components/lib/qtmaterialcheckable_p.h @@ -2,13 +2,18 @@ #define QTMATERIALCHECKABLE_P_H #include +#include +#include +#include +#include +#include +#include +#include + #include "lib/qtmaterialcheckable.h" namespace md { -class QStateMachine; -class QState; -class QSignalTransition; class RippleOverlay; class CheckableIcon; diff --git a/components/qtmaterialautocomplete.cpp b/components/qtmaterialautocomplete.cpp index 62ac90dc1..ecaf1fe61 100644 --- a/components/qtmaterialautocomplete.cpp +++ b/components/qtmaterialautocomplete.cpp @@ -1,13 +1,5 @@ -#include "qtmaterialautocomplete.h" #include "qtmaterialautocomplete_p.h" -#include -#include -#include -#include -#include -#include -#include "qtmaterialautocomplete_internal.h" -#include "qtmaterialflatbutton.h" + namespace md { diff --git a/components/qtmaterialautocomplete_p.h b/components/qtmaterialautocomplete_p.h index 29dc8525a..fd5004cb6 100644 --- a/components/qtmaterialautocomplete_p.h +++ b/components/qtmaterialautocomplete_p.h @@ -1,13 +1,21 @@ #ifndef QTMATERIALAUTOCOMPLETE_P_H #define QTMATERIALAUTOCOMPLETE_P_H +#include +#include +#include +#include +#include +#include + +#include "qtmaterialautocomplete.h" +#include "qtmaterialautocomplete_internal.h" +#include "qtmaterialflatbutton.h" #include "qtmaterialtextfield_p.h" namespace md { -class QWidget; -class QVBoxLayout; class AutoCompleteOverlay; class AutoCompleteStateMachine; diff --git a/components/qtmaterialcheckbox.cpp b/components/qtmaterialcheckbox.cpp index 4d4122c9c..9ef8e5157 100644 --- a/components/qtmaterialcheckbox.cpp +++ b/components/qtmaterialcheckbox.cpp @@ -1,9 +1,5 @@ -#include "qtmaterialcheckbox.h" #include "qtmaterialcheckbox_p.h" -#include -#include -#include -#include "lib/qtmaterialcheckable_internal.h" + namespace md { diff --git a/components/qtmaterialcheckbox_p.h b/components/qtmaterialcheckbox_p.h index c79f9def3..565e6c144 100644 --- a/components/qtmaterialcheckbox_p.h +++ b/components/qtmaterialcheckbox_p.h @@ -1,7 +1,14 @@ #ifndef QTMATERIALCHECKBOX_P_H #define QTMATERIALCHECKBOX_P_H +#include +#include +#include + +#include "qtmaterialcheckbox.h" +#include "lib/qtmaterialcheckable_internal.h" #include "lib/qtmaterialcheckable_p.h" + namespace md { diff --git a/components/qtmaterialdialog.cpp b/components/qtmaterialdialog.cpp index 109f50eec..7a5a6d860 100644 --- a/components/qtmaterialdialog.cpp +++ b/components/qtmaterialdialog.cpp @@ -1,19 +1,10 @@ #include "qtmaterialdialog.h" -#include "qtmaterialdialog_p.h" -#include -#include -#include -#include -#include -#include -#include -#include "qtmaterialdialog_internal.h" -#include "lib/qtmaterialstatetransition.h" + namespace md { /*! - * \class QtMaterialDialogPrivate + * \class DialogPrivate * \internal */ @@ -106,7 +97,7 @@ void DialogPrivate::init() } /*! - * \class QtMaterialDialog + * \class Dialog */ Dialog::Dialog(QWidget *parent) diff --git a/components/qtmaterialdialog.h b/components/qtmaterialdialog.h index af40fcfda..fc3c668ac 100644 --- a/components/qtmaterialdialog.h +++ b/components/qtmaterialdialog.h @@ -2,11 +2,16 @@ #define QTMATERIALDIALOG_H #include +#include + +#include "qtmaterialdialog_p.h" +#include "qtmaterialdialog_internal.h" +#include "lib/qtmaterialstatetransition.h" #include "lib/qtmaterialoverlaywidget.h" + namespace md { -class QLayout; class DialogPrivate; class Dialog : public OverlayWidget diff --git a/components/qtmaterialdialog_internal.cpp b/components/qtmaterialdialog_internal.cpp index 9780f8d1c..c93ffbb3d 100644 --- a/components/qtmaterialdialog_internal.cpp +++ b/components/qtmaterialdialog_internal.cpp @@ -1,9 +1,5 @@ #include "qtmaterialdialog_internal.h" -#include -#include -#include -#include -#include "qtmaterialdialog.h" + namespace md { diff --git a/components/qtmaterialdialog_internal.h b/components/qtmaterialdialog_internal.h index 86695da12..b1f49de8d 100644 --- a/components/qtmaterialdialog_internal.h +++ b/components/qtmaterialdialog_internal.h @@ -2,10 +2,16 @@ #define QTMATERIALDIALOG_INTERNAL_H #include +#include +#include +#include +#include + +#include "qtmaterialdialog.h" + namespace md { -class QStackedLayout; class Dialog; class DialogWindow; @@ -77,6 +83,7 @@ class DialogWindow : public QWidget Dialog *const m_dialog; }; +} #endif // QTMATERIALDIALOG_INTERNAL_H -} + diff --git a/components/qtmaterialdialog_p.h b/components/qtmaterialdialog_p.h index f59fa1608..7e104ec29 100644 --- a/components/qtmaterialdialog_p.h +++ b/components/qtmaterialdialog_p.h @@ -2,12 +2,18 @@ #define QTMATERIALDIALOG_P_H #include +#include +#include +#include +#include +#include +#include +#include + namespace md { -class QStateMachine; class Dialog; -class QStackedLayout; class DialogWindow; class DialogProxy; diff --git a/components/qtmaterialdrawer.cpp b/components/qtmaterialdrawer.cpp index 3ab6094d3..c6dc1747b 100644 --- a/components/qtmaterialdrawer.cpp +++ b/components/qtmaterialdrawer.cpp @@ -1,14 +1,5 @@ #include "qtmaterialdrawer.h" -#include "qtmaterialdrawer_p.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "qtmaterialdrawer_internal.h" + namespace md { diff --git a/components/qtmaterialdrawer.h b/components/qtmaterialdrawer.h index f6628ff5e..b0e7f0a83 100644 --- a/components/qtmaterialdrawer.h +++ b/components/qtmaterialdrawer.h @@ -1,7 +1,19 @@ #ifndef QTMATERIALDRAWER_H #define QTMATERIALDRAWER_H +#include +#include +#include +#include +#include +#include +#include +#include + +#include "qtmaterialdrawer_p.h" +#include "qtmaterialdrawer_internal.h" #include "lib/qtmaterialoverlaywidget.h" + namespace md { diff --git a/components/qtmaterialflatbutton_internal.cpp b/components/qtmaterialflatbutton_internal.cpp index 8591ba8bc..53142c558 100644 --- a/components/qtmaterialflatbutton_internal.cpp +++ b/components/qtmaterialflatbutton_internal.cpp @@ -1,10 +1,4 @@ #include "qtmaterialflatbutton_internal.h" -#include -#include -#include -#include -#include "qtmaterialflatbutton.h" -#include "lib/qtmaterialstatetransition.h" namespace md { diff --git a/components/qtmaterialflatbutton_internal.h b/components/qtmaterialflatbutton_internal.h index bf2361bcd..8eef9ff46 100644 --- a/components/qtmaterialflatbutton_internal.h +++ b/components/qtmaterialflatbutton_internal.h @@ -3,12 +3,18 @@ #include #include +#include +#include +#include +#include + +#include "qtmaterialflatbutton.h" +#include "lib/qtmaterialstatetransition.h" namespace md { -class FlatButton; -class QSequentialAnimationGroup; +class FlatButton; class FlatButtonStateMachine : public QStateMachine { Q_OBJECT diff --git a/components/qtmaterialiconbutton_p.h b/components/qtmaterialiconbutton_p.h index 42d071e6d..1d8b64277 100644 --- a/components/qtmaterialiconbutton_p.h +++ b/components/qtmaterialiconbutton_p.h @@ -2,13 +2,12 @@ #define QTMATERIALICONBUTTON_P_H #include - +#include namespace md { class IconButton; class RippleOverlay; -class QColor; class IconButtonPrivate { diff --git a/components/qtmaterialprogress_internal.cpp b/components/qtmaterialprogress_internal.cpp index d2b23616e..6b970c6ff 100644 --- a/components/qtmaterialprogress_internal.cpp +++ b/components/qtmaterialprogress_internal.cpp @@ -1,5 +1,7 @@ #include "qtmaterialprogress_internal.h" +namespace md +{ /*! * \class QtMaterialProgressDelegate * \internal @@ -16,3 +18,4 @@ ProgressBarDelegate::ProgressBarDelegate(ProgressBar *parent) ProgressBarDelegate::~ProgressBarDelegate() { } +} diff --git a/components/qtmaterialprogress_internal.h b/components/qtmaterialprogress_internal.h index 2f936ed41..67a507f2c 100644 --- a/components/qtmaterialprogress_internal.h +++ b/components/qtmaterialprogress_internal.h @@ -3,6 +3,7 @@ #include #include "qtmaterialprogress.h" + namespace md { diff --git a/components/qtmaterialradiobutton.cpp b/components/qtmaterialradiobutton.cpp index 2eecd8169..816deb09d 100644 --- a/components/qtmaterialradiobutton.cpp +++ b/components/qtmaterialradiobutton.cpp @@ -1,16 +1,11 @@ #include "qtmaterialradiobutton.h" -#include "qtmaterialradiobutton_p.h" -#include -#include -#include -#include -#include "lib/qtmaterialcheckable_internal.h" + namespace md { /*! - * \class QtMaterialRadioButtonPrivate + * \class RadioButtonPrivate * \internal */ diff --git a/components/qtmaterialradiobutton.h b/components/qtmaterialradiobutton.h index 4b737ea63..66b916b81 100644 --- a/components/qtmaterialradiobutton.h +++ b/components/qtmaterialradiobutton.h @@ -1,7 +1,10 @@ #ifndef QTMATERIALRADIOBUTTON_H #define QTMATERIALRADIOBUTTON_H +#include "qtmaterialradiobutton_p.h" +#include "lib/qtmaterialcheckable_internal.h" #include "lib/qtmaterialcheckable.h" + namespace md { diff --git a/components/qtmaterialradiobutton_p.h b/components/qtmaterialradiobutton_p.h index 6a25181a8..0d32fea5b 100644 --- a/components/qtmaterialradiobutton_p.h +++ b/components/qtmaterialradiobutton_p.h @@ -1,7 +1,14 @@ #ifndef QTMATERIALRADIOBUTTON_P_H #define QTMATERIALRADIOBUTTON_P_H +#include +#include +#include +#include + +#include "qtmaterialradiobutton.h" #include "lib/qtmaterialcheckable_p.h" + namespace md { diff --git a/components/qtmaterialraisedbutton.cpp b/components/qtmaterialraisedbutton.cpp index b7b8ad6a3..663234653 100644 --- a/components/qtmaterialraisedbutton.cpp +++ b/components/qtmaterialraisedbutton.cpp @@ -1,9 +1,5 @@ -#include "qtmaterialraisedbutton.h" #include "qtmaterialraisedbutton_p.h" -#include -#include -#include -#include + namespace md { diff --git a/components/qtmaterialraisedbutton.h b/components/qtmaterialraisedbutton.h index 7482a55a6..aa4ea94c4 100644 --- a/components/qtmaterialraisedbutton.h +++ b/components/qtmaterialraisedbutton.h @@ -2,6 +2,7 @@ #define QTMATERIALRAISEDBUTTON_H #include "qtmaterialflatbutton.h" + namespace md { diff --git a/components/qtmaterialraisedbutton_p.h b/components/qtmaterialraisedbutton_p.h index 545efe9bb..615bc11c8 100644 --- a/components/qtmaterialraisedbutton_p.h +++ b/components/qtmaterialraisedbutton_p.h @@ -1,13 +1,17 @@ #ifndef QTMATERIALRAISEDBUTTON_P_H #define QTMATERIALRAISEDBUTTON_P_H +#include +#include +#include +#include + #include "qtmaterialflatbutton_p.h" +#include "qtmaterialraisedbutton.h" + namespace md { -class QStateMachine; -class QState; -class QGraphicsDropShadowEffect; class RaisedButton; class RaisedButtonPrivate : public FlatButtonPrivate diff --git a/components/qtmaterialscrollbar.cpp b/components/qtmaterialscrollbar.cpp index b0986539a..5c6a0c1b3 100644 --- a/components/qtmaterialscrollbar.cpp +++ b/components/qtmaterialscrollbar.cpp @@ -1,10 +1,5 @@ #include "qtmaterialscrollbar.h" -#include "qtmaterialscrollbar_p.h" -#include -#include -#include -#include "qtmaterialscrollbar_internal.h" -#include "lib/qtmaterialstyle.h" + namespace md { diff --git a/components/qtmaterialscrollbar.h b/components/qtmaterialscrollbar.h index aef78dc16..0ff4b5fcc 100644 --- a/components/qtmaterialscrollbar.h +++ b/components/qtmaterialscrollbar.h @@ -2,6 +2,14 @@ #define QTMATERIALSCROLLBAR_H #include +#include +#include +#include + +#include "qtmaterialscrollbar_p.h" +#include "qtmaterialscrollbar_internal.h" +#include "lib/qtmaterialstyle.h" + namespace md { diff --git a/components/qtmaterialscrollbar_internal.h b/components/qtmaterialscrollbar_internal.h index d05412007..013cd506c 100644 --- a/components/qtmaterialscrollbar_internal.h +++ b/components/qtmaterialscrollbar_internal.h @@ -3,9 +3,12 @@ #include #include "qtmaterialscrollbar.h" + namespace md { +class ScrollBar; + class ScrollBarStateMachine : public QStateMachine { Q_OBJECT @@ -31,7 +34,7 @@ class ScrollBarStateMachine : public QStateMachine inline void ScrollBarStateMachine::setOpacity(qreal opacity) { m_opacity = opacity; - m_scrollBar->update(); +// m_scrollBar->update(); // FIXME: incomplete type 'class md::ScrollBar' } inline qreal ScrollBarStateMachine::opacity() const diff --git a/components/qtmaterialscrollbar_p.h b/components/qtmaterialscrollbar_p.h index 2d73e733d..efcd191b1 100644 --- a/components/qtmaterialscrollbar_p.h +++ b/components/qtmaterialscrollbar_p.h @@ -3,6 +3,7 @@ #include #include + namespace md { diff --git a/components/qtmaterialslider.cpp b/components/qtmaterialslider.cpp index e7eccb7e5..797c20a46 100644 --- a/components/qtmaterialslider.cpp +++ b/components/qtmaterialslider.cpp @@ -5,6 +5,7 @@ #include "qtmaterialslider_internal.h" #include "lib/qtmaterialstyle.h" #include "lib/qtmaterialstatetransitionevent.h" + namespace md { diff --git a/components/qtmaterialslider.h b/components/qtmaterialslider.h index c13c03aa4..2f14e75e3 100644 --- a/components/qtmaterialslider.h +++ b/components/qtmaterialslider.h @@ -5,6 +5,7 @@ #include #define QT_MATERIAL_SLIDER_MARGIN 30 + namespace md { diff --git a/components/qtmaterialslider_p.h b/components/qtmaterialslider_p.h index d36191d6e..d372b2fb2 100644 --- a/components/qtmaterialslider_p.h +++ b/components/qtmaterialslider_p.h @@ -4,6 +4,7 @@ #include #include #include + namespace md { diff --git a/components/qtmaterialsnackbar.h b/components/qtmaterialsnackbar.h index 547b0c2c7..c47a2752b 100644 --- a/components/qtmaterialsnackbar.h +++ b/components/qtmaterialsnackbar.h @@ -2,6 +2,7 @@ #define QTMATERIALSNACKBAR_H #include "lib/qtmaterialoverlaywidget.h" + namespace md { diff --git a/components/qtmaterialsnackbar_internal.h b/components/qtmaterialsnackbar_internal.h index dbeb0de5e..0cf3a1133 100644 --- a/components/qtmaterialsnackbar_internal.h +++ b/components/qtmaterialsnackbar_internal.h @@ -3,6 +3,7 @@ #include #include + namespace md { diff --git a/components/qtmaterialsnackbar_p.h b/components/qtmaterialsnackbar_p.h index 828cdf44d..a24ba57d0 100644 --- a/components/qtmaterialsnackbar_p.h +++ b/components/qtmaterialsnackbar_p.h @@ -3,6 +3,7 @@ #include #include + namespace md { @@ -12,7 +13,7 @@ class SnackBarStateMachine; class SnackBarPrivate { Q_DISABLE_COPY(SnackBarPrivate) - Q_DECLARE_PUBLIC(Snackbar) + Q_DECLARE_PUBLIC(SnackBar) public: SnackBarPrivate(SnackBar *q); diff --git a/components/qtmaterialtabs.cpp b/components/qtmaterialtabs.cpp index d5e5defce..04bb7742c 100644 --- a/components/qtmaterialtabs.cpp +++ b/components/qtmaterialtabs.cpp @@ -1,13 +1,10 @@ #include "qtmaterialtabs.h" -#include "qtmaterialtabs_p.h" -#include -#include "qtmaterialtabs_internal.h" -#include "lib/qtmaterialstyle.h" + namespace md { /*! - * \QtMaterialTabsPrivate + * \TabsPrivate * \internal */ @@ -35,7 +32,8 @@ void TabsPrivate::TabsPrivate::init() q->setStyle(&Style::instance()); tabLayout->setSpacing(0); - tabLayout->setMargin(0); + +// tabLayout->setMargin(0); // FIXME: throwing an error } /*! diff --git a/components/qtmaterialtabs.h b/components/qtmaterialtabs.h index ba505446c..b3517d63f 100644 --- a/components/qtmaterialtabs.h +++ b/components/qtmaterialtabs.h @@ -2,8 +2,14 @@ #define QTMATERIALTABS_H #include +#include #include + +#include "qtmaterialtabs_p.h" +#include "qtmaterialtabs_internal.h" +#include "lib/qtmaterialstyle.h" #include "lib/qtmaterialtheme.h" + namespace md { diff --git a/components/qtmaterialtabs_internal.cpp b/components/qtmaterialtabs_internal.cpp index 06e9c7ff0..951a6a1b3 100644 --- a/components/qtmaterialtabs_internal.cpp +++ b/components/qtmaterialtabs_internal.cpp @@ -1,11 +1,5 @@ #include "qtmaterialtabs_internal.h" -#include -#include -#include -#include -#include -#include "qtmaterialtabs.h" -#include + namespace md { diff --git a/components/qtmaterialtabs_internal.h b/components/qtmaterialtabs_internal.h index 81f82f507..e05932e91 100644 --- a/components/qtmaterialtabs_internal.h +++ b/components/qtmaterialtabs_internal.h @@ -1,13 +1,20 @@ #ifndef QTMATERIALTABS_INTERNAL_H #define QTMATERIALTABS_INTERNAL_H +#include +#include +#include +#include +#include +#include + +#include "qtmaterialtabs.h" #include "lib/qtmaterialoverlaywidget.h" #include "qtmaterialflatbutton.h" namespace md { -class QPropertyAnimation; class Tabs; class TabsInkBar : public OverlayWidget diff --git a/components/qtmaterialtabs_p.h b/components/qtmaterialtabs_p.h index e9165de7d..2698219ed 100644 --- a/components/qtmaterialtabs_p.h +++ b/components/qtmaterialtabs_p.h @@ -2,11 +2,13 @@ #define QTMATERIALTABS_P_H #include +#include + #include "lib/qtmaterialtheme.h" + namespace md { -class QHBoxLayout; class Tabs; class TabsInkBar; diff --git a/components/qtmaterialtextfield.h b/components/qtmaterialtextfield.h index c845809a4..4ecd074a4 100644 --- a/components/qtmaterialtextfield.h +++ b/components/qtmaterialtextfield.h @@ -3,6 +3,7 @@ #include #include + namespace md { diff --git a/components/qtmaterialtextfield_internal.cpp b/components/qtmaterialtextfield_internal.cpp index fa148ce88..be79e20fb 100644 --- a/components/qtmaterialtextfield_internal.cpp +++ b/components/qtmaterialtextfield_internal.cpp @@ -1,13 +1,10 @@ #include "qtmaterialtextfield_internal.h" -#include -#include -#include -#include "qtmaterialtextfield.h" + namespace md { /*! - * \class QtMaterialTextFieldStateMachine + * \class TextFieldStateMachine * \internal */ diff --git a/components/qtmaterialtextfield_internal.h b/components/qtmaterialtextfield_internal.h index fd8ab5800..0600d3158 100644 --- a/components/qtmaterialtextfield_internal.h +++ b/components/qtmaterialtextfield_internal.h @@ -1,13 +1,17 @@ #ifndef QTMATERIALTEXTFIELD_INTERNAL_H #define QTMATERIALTEXTFIELD_INTERNAL_H -#include #include +#include +#include +#include +#include + #include "qtmaterialtextfield.h" + namespace md { -class QPropertyAnimation; class TextFieldLabel; class TextFieldStateMachine : public QStateMachine diff --git a/components/qtmaterialtoggle.cpp b/components/qtmaterialtoggle.cpp index 08c820e09..dd9ebe951 100644 --- a/components/qtmaterialtoggle.cpp +++ b/components/qtmaterialtoggle.cpp @@ -1,11 +1,9 @@ #include "qtmaterialtoggle.h" + #include "qtmaterialtoggle_p.h" -#include -#include -#include -#include #include "qtmaterialtoggle_internal.h" #include "lib/qtmaterialstyle.h" + namespace md { diff --git a/components/qtmaterialtoggle.h b/components/qtmaterialtoggle.h index 25f0d0fcd..fe2efe17d 100644 --- a/components/qtmaterialtoggle.h +++ b/components/qtmaterialtoggle.h @@ -2,6 +2,7 @@ #define QTMATERIALTOGGLE_H #include + namespace md { diff --git a/components/qtmaterialtoggle_internal.cpp b/components/qtmaterialtoggle_internal.cpp index 3579769f8..86f3e9160 100644 --- a/components/qtmaterialtoggle_internal.cpp +++ b/components/qtmaterialtoggle_internal.cpp @@ -1,9 +1,8 @@ #include "qtmaterialtoggle_internal.h" -#include -#include -#include + #include "qtmaterialtoggle.h" #include "lib/qtmaterialripple.h" + namespace md { diff --git a/components/qtmaterialtoggle_internal.h b/components/qtmaterialtoggle_internal.h index 6fb084db2..4d4494ef7 100644 --- a/components/qtmaterialtoggle_internal.h +++ b/components/qtmaterialtoggle_internal.h @@ -2,7 +2,12 @@ #define QTMATERIALTOGGLE_INTERNAL_H #include +#include +#include +#include + #include "lib/qtmaterialrippleoverlay.h" + namespace md { diff --git a/components/qtmaterialtoggle_p.h b/components/qtmaterialtoggle_p.h index 4b7196d2c..bcd3b6a54 100644 --- a/components/qtmaterialtoggle_p.h +++ b/components/qtmaterialtoggle_p.h @@ -1,13 +1,15 @@ #ifndef QTMATERIALTOGGLE_P_H #define QTMATERIALTOGGLE_P_H -#include +#include +#include +#include +#include +#include + namespace md { -class QStateMachine; -class QState; -class QColor; class Toggle; class ToggleTrack; class ToggleThumb; From 0edcedc44eadd24e36eae179fe2e76591ebc6ce7 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 13:40:12 +0100 Subject: [PATCH 36/46] Testing more widgets .. --- examples/CMakeLists.txt | 12 ++++++------ examples/appbarsettingseditor.cpp | 11 +++-------- examples/appbarsettingseditor.h | 12 ++++++++++-- examples/avatarsettingseditor.h | 2 +- examples/badgesettingseditor.cpp | 4 ++-- examples/badgesettingseditor.h | 9 ++++++--- examples/mainwindow.cpp | 13 +++++++------ examples/mainwindow.h | 4 ++-- 8 files changed, 37 insertions(+), 30 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index dd11115ca..4883c49a6 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -24,7 +24,7 @@ set(PROJECT_SOURCES main.cpp mainwindow.cpp avatarsettingseditor.cpp -# badgesettingseditor.cpp + badgesettingseditor.cpp # checkboxsettingseditor.cpp # fabsettingseditor.cpp # raisedbuttonsettingseditor.cpp @@ -41,13 +41,13 @@ set(PROJECT_SOURCES # dialogsettingseditor.cpp # drawersettingseditor.cpp # scrollbarsettingseditor.cpp -# appbarsettingseditor.cpp + appbarsettingseditor.cpp # autocompletesettingseditor.cpp # menusettingseditor.cpp # Headers mainwindow.h avatarsettingseditor.h -# badgesettingseditor.h + badgesettingseditor.h # checkboxsettingseditor.h # fabsettingseditor.h # raisedbuttonsettingseditor.h @@ -64,12 +64,12 @@ set(PROJECT_SOURCES # dialogsettingseditor.h # drawersettingseditor.h # scrollbarsettingseditor.h -# appbarsettingseditor.h + appbarsettingseditor.h # autocompletesettingseditor.h # menusettingseditor.h # Forms avatarsettingsform.ui -# badgesettingsform.ui + badgesettingsform.ui # checkboxsettingsform.ui # fabsettingsform.ui # flatbuttonsettingsform.ui @@ -85,7 +85,7 @@ set(PROJECT_SOURCES # dialogsettingsform.ui # drawersettingsform.ui # scrollbarsettingsform.ui -# appbarsettingsform.ui + appbarsettingsform.ui ) if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) diff --git a/examples/appbarsettingseditor.cpp b/examples/appbarsettingseditor.cpp index 5f2ce00af..89d780347 100644 --- a/examples/appbarsettingseditor.cpp +++ b/examples/appbarsettingseditor.cpp @@ -1,18 +1,13 @@ #include "appbarsettingseditor.h" -#include -#include -#include -#include -#include AppBarSettingsEditor::AppBarSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::AppBarSettingsForm), - m_appBar(new QtMaterialAppBar) + m_appBar(new AppBar) { QLabel *label = new QLabel("Inbox"); label->setAttribute(Qt::WA_TranslucentBackground); - label->setForegroundRole(QPalette::Foreground); +// label->setForegroundRole(QPalette::Foreground); // FIXME: palette ? foreground ! label->setContentsMargins(6, 0, 0, 0); QPalette palette = label->palette(); @@ -21,7 +16,7 @@ AppBarSettingsEditor::AppBarSettingsEditor(QWidget *parent) label->setFont(QFont("Roboto", 18, QFont::Normal)); - QtMaterialIconButton *button = new QtMaterialIconButton(QtMaterialTheme::icon("navigation", "menu")); + IconButton *button = new IconButton(Theme::icon("navigation", "menu")); button->setIconSize(QSize(24, 24)); m_appBar->appBarLayout()->addWidget(button); m_appBar->appBarLayout()->addWidget(label); diff --git a/examples/appbarsettingseditor.h b/examples/appbarsettingseditor.h index b2eb88252..be9dce3d2 100644 --- a/examples/appbarsettingseditor.h +++ b/examples/appbarsettingseditor.h @@ -2,9 +2,17 @@ #define APPBARSETTINGSEDITOR_H #include +#include +#include +#include + +#include +#include +#include + #include "ui_appbarsettingsform.h" -class QtMaterialAppBar; +using namespace md; class AppBarSettingsEditor : public QWidget { @@ -21,7 +29,7 @@ protected slots: private: Ui::AppBarSettingsForm *const ui; - QtMaterialAppBar *const m_appBar; + AppBar *const m_appBar; }; #endif // APPBARSETTINGSEDITOR_H diff --git a/examples/avatarsettingseditor.h b/examples/avatarsettingseditor.h index 6485fa0fd..eda4fe10e 100644 --- a/examples/avatarsettingseditor.h +++ b/examples/avatarsettingseditor.h @@ -6,10 +6,10 @@ #include #include #include + #include "ui_avatarsettingsform.h" using namespace md; -//class Avatar; class AvatarSettingsEditor : public QWidget { diff --git a/examples/badgesettingseditor.cpp b/examples/badgesettingseditor.cpp index 9e70d7b55..5f2be5e47 100644 --- a/examples/badgesettingseditor.cpp +++ b/examples/badgesettingseditor.cpp @@ -7,7 +7,7 @@ BadgeSettingsEditor::BadgeSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::BadgeSettingsForm), m_avatar(new Avatar(QImage(":/images/assets/sikh.jpg"))), - m_badge(new QtMaterialBadge) + m_badge(new Badge) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); @@ -73,7 +73,7 @@ void BadgeSettingsEditor::updateWidget() m_badge->setText("3"); break; case 1: - m_badge->setIcon(QIcon(QtMaterialTheme::icon("communication", "message"))); + m_badge->setIcon(QIcon(Theme::icon("communication", "message"))); break; default: break; diff --git a/examples/badgesettingseditor.h b/examples/badgesettingseditor.h index 531dfb26a..3e22ae112 100644 --- a/examples/badgesettingseditor.h +++ b/examples/badgesettingseditor.h @@ -2,10 +2,13 @@ #define BADGESETTINGSEDITOR_H #include + +#include +#include + #include "ui_badgesettingsform.h" -class Avatar; -class QtMaterialBadge; +using namespace md; class BadgeSettingsEditor : public QWidget { @@ -23,7 +26,7 @@ protected slots: private: Ui::BadgeSettingsForm *const ui; Avatar *const m_avatar; - QtMaterialBadge *const m_badge; + Badge *const m_badge; }; #endif // BADGESETTINGSEDITOR_H diff --git a/examples/mainwindow.cpp b/examples/mainwindow.cpp index 773a61d6c..cc45106d5 100644 --- a/examples/mainwindow.cpp +++ b/examples/mainwindow.cpp @@ -3,6 +3,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { + this->showMaximized(); QWidget *widget = new QWidget; QHBoxLayout *layout = new QHBoxLayout; @@ -19,7 +20,7 @@ MainWindow::MainWindow(QWidget *parent) setCentralWidget(widget); AvatarSettingsEditor *avatar = new AvatarSettingsEditor; -// BadgeSettingsEditor *badge = new BadgeSettingsEditor; + BadgeSettingsEditor *badge = new BadgeSettingsEditor; // CheckBoxSettingsEditor *checkbox = new CheckBoxSettingsEditor; // FloatingActionButtonSettingsEditor *fab = new FloatingActionButtonSettingsEditor; // RaisedButtonSettingsEditor *raisedButton = new RaisedButtonSettingsEditor; @@ -36,14 +37,14 @@ MainWindow::MainWindow(QWidget *parent) // DialogSettingsEditor *dialog = new DialogSettingsEditor; // DrawerSettingsEditor *drawer = new DrawerSettingsEditor; // ScrollBarSettingsEditor *scrollBar = new ScrollBarSettingsEditor; -// AppBarSettingsEditor *appBar = new AppBarSettingsEditor; + AppBarSettingsEditor *appBar = new AppBarSettingsEditor; // AutoCompleteSettingsEditor *autocomplete = new AutoCompleteSettingsEditor; // MenuSettingsEditor *menu = new MenuSettingsEditor; stack->addWidget(avatar); -// stack->addWidget(appBar); + stack->addWidget(appBar); // stack->addWidget(autocomplete); -// stack->addWidget(badge); + stack->addWidget(badge); // stack->addWidget(checkbox); // stack->addWidget(circularProgress); // stack->addWidget(dialog); @@ -64,9 +65,9 @@ MainWindow::MainWindow(QWidget *parent) list->addItem("Avatar"); -// list->addItem("App Bar"); + list->addItem("App Bar"); // list->addItem("Auto Complete"); -// list->addItem("Badge"); + list->addItem("Badge"); // list->addItem("Checkbox"); // list->addItem("Circular Progress"); // list->addItem("Dialog"); diff --git a/examples/mainwindow.h b/examples/mainwindow.h index 856795a74..955035684 100644 --- a/examples/mainwindow.h +++ b/examples/mainwindow.h @@ -7,7 +7,7 @@ #include #include "avatarsettingseditor.h" -//#include "badgesettingseditor.h" +#include "badgesettingseditor.h" //#include "checkboxsettingseditor.h" //#include "fabsettingseditor.h" //#include "raisedbuttonsettingseditor.h" @@ -24,7 +24,7 @@ //#include "dialogsettingseditor.h" //#include "drawersettingseditor.h" //#include "scrollbarsettingseditor.h" -//#include "appbarsettingseditor.h" +#include "appbarsettingseditor.h" //#include "autocompletesettingseditor.h" //#include "menusettingseditor.h" From 09cc27e2adb1ccba0adf63c5a279ec0d4f76b00d Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 15:21:05 +0100 Subject: [PATCH 37/46] Fix the component "RadioButton" issue. --- components/CMakeLists.txt | 8 +++++--- components/qtmaterialdialog_p.h | 3 ++- components/qtmaterialradiobutton.cpp | 4 ++-- components/qtmaterialradiobutton.h | 2 -- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 98869059a..29e16fbe6 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -14,6 +14,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Gui REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core5Compat REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS StateMachine REQUIRED) @@ -44,7 +45,7 @@ set(PROJECT_SOURCES qtmaterialslider.cpp qtmaterialsnackbar_internal.cpp qtmaterialsnackbar.cpp -# qtmaterialradiobutton.cpp + qtmaterialradiobutton.cpp qtmaterialtoggle_internal.cpp qtmaterialtoggle.cpp qtmaterialtextfield_internal.cpp @@ -106,8 +107,8 @@ set(PROJECT_SOURCES qtmaterialsnackbar_internal.h qtmaterialsnackbar_p.h qtmaterialsnackbar.h -# qtmaterialradiobutton_p.h -# qtmaterialradiobutton.h + qtmaterialradiobutton_p.h + qtmaterialradiobutton.h qtmaterialtoggle_internal.h qtmaterialtoggle_p.h qtmaterialtoggle.h @@ -164,6 +165,7 @@ endif() target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::Core) +target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::Gui) target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::Core5Compat) target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::StateMachine) diff --git a/components/qtmaterialdialog_p.h b/components/qtmaterialdialog_p.h index 7e104ec29..d1b7cbf5f 100644 --- a/components/qtmaterialdialog_p.h +++ b/components/qtmaterialdialog_p.h @@ -2,9 +2,10 @@ #define QTMATERIALDIALOG_P_H #include +#include #include #include -#include + #include #include #include diff --git a/components/qtmaterialradiobutton.cpp b/components/qtmaterialradiobutton.cpp index 816deb09d..f1800134a 100644 --- a/components/qtmaterialradiobutton.cpp +++ b/components/qtmaterialradiobutton.cpp @@ -1,9 +1,9 @@ #include "qtmaterialradiobutton.h" +#include "qtmaterialradiobutton_p.h" +#include "lib/qtmaterialcheckable_internal.h" namespace md { - - /*! * \class RadioButtonPrivate * \internal diff --git a/components/qtmaterialradiobutton.h b/components/qtmaterialradiobutton.h index 66b916b81..b6986a312 100644 --- a/components/qtmaterialradiobutton.h +++ b/components/qtmaterialradiobutton.h @@ -1,8 +1,6 @@ #ifndef QTMATERIALRADIOBUTTON_H #define QTMATERIALRADIOBUTTON_H -#include "qtmaterialradiobutton_p.h" -#include "lib/qtmaterialcheckable_internal.h" #include "lib/qtmaterialcheckable.h" namespace md From 0db2da80a4dc4f8140a80c63c9ba9ed3610a3c91 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 15:22:14 +0100 Subject: [PATCH 38/46] all available Material widgets examples WORKS OKAY. --- examples/CMakeLists.txt | 104 ++++++++++--------- examples/autocompletesettingseditor.cpp | 5 +- examples/autocompletesettingseditor.h | 9 +- examples/checkboxsettingseditor.cpp | 13 +-- examples/checkboxsettingseditor.h | 9 +- examples/circularprogresssettingseditor.cpp | 5 +- examples/circularprogresssettingseditor.h | 9 +- examples/dialogsettingseditor.cpp | 8 +- examples/dialogsettingseditor.h | 10 +- examples/drawersettingseditor.cpp | 5 +- examples/drawersettingseditor.h | 9 +- examples/fabsettingseditor.cpp | 6 +- examples/fabsettingseditor.h | 10 +- examples/flatbuttonsettingseditor.cpp | 9 +- examples/flatbuttonsettingseditor.h | 11 +- examples/iconbuttonsettingseditor.cpp | 5 +- examples/iconbuttonsettingseditor.h | 11 +- examples/mainwindow.cpp | 108 ++++++++++---------- examples/mainwindow.h | 36 +++---- examples/menusettingseditor.cpp | 5 +- examples/menusettingseditor.h | 10 +- examples/progresssettingseditor.cpp | 5 +- examples/progresssettingseditor.h | 9 +- examples/radiobuttonsettingseditor.cpp | 28 +++-- examples/radiobuttonsettingseditor.h | 15 ++- examples/raisedbuttonsettingseditor.cpp | 3 +- examples/raisedbuttonsettingseditor.h | 3 + examples/scrollbarsettingseditor.cpp | 8 +- examples/scrollbarsettingseditor.h | 12 ++- examples/slidersettingseditor.cpp | 5 +- examples/slidersettingseditor.h | 9 +- examples/snackbarsettingseditor.cpp | 5 +- examples/snackbarsettingseditor.h | 9 +- examples/tabssettingseditor.cpp | 5 +- examples/tabssettingseditor.h | 9 +- examples/textfieldsettingseditor.cpp | 5 +- examples/textfieldsettingseditor.h | 9 +- examples/togglesettingseditor.cpp | 4 +- examples/togglesettingseditor.h | 8 +- 39 files changed, 292 insertions(+), 256 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 4883c49a6..d3be2fc71 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -14,6 +14,7 @@ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Gui REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core5Compat REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS StateMachine REQUIRED) # Add executable called "examples" that is built from the source files # "*.cpp". The extensions are automatically found. @@ -25,66 +26,66 @@ set(PROJECT_SOURCES mainwindow.cpp avatarsettingseditor.cpp badgesettingseditor.cpp -# checkboxsettingseditor.cpp -# fabsettingseditor.cpp -# raisedbuttonsettingseditor.cpp -# flatbuttonsettingseditor.cpp -# iconbuttonsettingseditor.cpp -# progresssettingseditor.cpp -# circularprogresssettingseditor.cpp -# slidersettingseditor.cpp -# radiobuttonsettingseditor.cpp -# togglesettingseditor.cpp -# textfieldsettingseditor.cpp -# tabssettingseditor.cpp -# snackbarsettingseditor.cpp -# dialogsettingseditor.cpp -# drawersettingseditor.cpp -# scrollbarsettingseditor.cpp + checkboxsettingseditor.cpp + fabsettingseditor.cpp + raisedbuttonsettingseditor.cpp + flatbuttonsettingseditor.cpp + iconbuttonsettingseditor.cpp + progresssettingseditor.cpp + circularprogresssettingseditor.cpp + slidersettingseditor.cpp + radiobuttonsettingseditor.cpp + togglesettingseditor.cpp + textfieldsettingseditor.cpp + tabssettingseditor.cpp + snackbarsettingseditor.cpp + dialogsettingseditor.cpp + drawersettingseditor.cpp + scrollbarsettingseditor.cpp appbarsettingseditor.cpp -# autocompletesettingseditor.cpp -# menusettingseditor.cpp + autocompletesettingseditor.cpp + menusettingseditor.cpp # Headers mainwindow.h avatarsettingseditor.h badgesettingseditor.h -# checkboxsettingseditor.h -# fabsettingseditor.h -# raisedbuttonsettingseditor.h -# flatbuttonsettingseditor.h -# iconbuttonsettingseditor.h -# progresssettingseditor.h -# circularprogresssettingseditor.h -# slidersettingseditor.h -# radiobuttonsettingseditor.h -# togglesettingseditor.h -# textfieldsettingseditor.h -# tabssettingseditor.h -# snackbarsettingseditor.h -# dialogsettingseditor.h -# drawersettingseditor.h -# scrollbarsettingseditor.h + checkboxsettingseditor.h + fabsettingseditor.h + raisedbuttonsettingseditor.h + flatbuttonsettingseditor.h + iconbuttonsettingseditor.h + progresssettingseditor.h + circularprogresssettingseditor.h + slidersettingseditor.h + radiobuttonsettingseditor.h + togglesettingseditor.h + textfieldsettingseditor.h + tabssettingseditor.h + snackbarsettingseditor.h + dialogsettingseditor.h + drawersettingseditor.h + scrollbarsettingseditor.h appbarsettingseditor.h -# autocompletesettingseditor.h -# menusettingseditor.h + autocompletesettingseditor.h + menusettingseditor.h # Forms avatarsettingsform.ui badgesettingsform.ui -# checkboxsettingsform.ui -# fabsettingsform.ui -# flatbuttonsettingsform.ui -# iconbuttonsettingsform.ui -# progresssettingsform.ui -# circularprogresssettingsform.ui -# slidersettingsform.ui -# snackbarsettingsform.ui -# radiobuttonsettingsform.ui -# togglesettingsform.ui -# textfieldsettingsform.ui -# tabssettingsform.ui -# dialogsettingsform.ui -# drawersettingsform.ui -# scrollbarsettingsform.ui + checkboxsettingsform.ui + fabsettingsform.ui + flatbuttonsettingsform.ui + iconbuttonsettingsform.ui + progresssettingsform.ui + circularprogresssettingsform.ui + slidersettingsform.ui + snackbarsettingsform.ui + radiobuttonsettingsform.ui + togglesettingsform.ui + textfieldsettingsform.ui + tabssettingsform.ui + dialogsettingsform.ui + drawersettingsform.ui + scrollbarsettingsform.ui appbarsettingsform.ui ) @@ -115,6 +116,7 @@ target_link_libraries(examples PRIVATE Qt${QT_VERSION_MAJOR}::Core) target_link_libraries(examples PRIVATE Qt${QT_VERSION_MAJOR}::Gui) target_link_libraries(examples PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) target_link_libraries(examples PRIVATE Qt${QT_VERSION_MAJOR}::Core5Compat) +target_link_libraries(examples PRIVATE Qt${QT_VERSION_MAJOR}::StateMachine) # Link the executable to the 'components' library. Since the 'components' library has diff --git a/examples/autocompletesettingseditor.cpp b/examples/autocompletesettingseditor.cpp index 0c8dedeca..d101670d3 100644 --- a/examples/autocompletesettingseditor.cpp +++ b/examples/autocompletesettingseditor.cpp @@ -1,12 +1,9 @@ #include "autocompletesettingseditor.h" -#include -#include -#include AutoCompleteSettingsEditor::AutoCompleteSettingsEditor(QWidget *parent) : QWidget(parent), //ui(new Ui::AutoCompleteSettingsForm), - m_autocomplete(new QtMaterialAutoComplete) + m_autocomplete(new AutoComplete) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); diff --git a/examples/autocompletesettingseditor.h b/examples/autocompletesettingseditor.h index b6c57433f..cbc7c3a14 100644 --- a/examples/autocompletesettingseditor.h +++ b/examples/autocompletesettingseditor.h @@ -4,9 +4,14 @@ #include //#include "ui_autocompletesettingsform.h" +#include +#include +#include + +#include #include "lib/qtmaterialoverlaywidget.h" -class QtMaterialAutoComplete; +using namespace md; class AutoCompleteSettingsEditor : public QWidget { @@ -23,7 +28,7 @@ protected slots: private: //Ui::AutoCompleteSettingsForm *const ui; - QtMaterialAutoComplete *const m_autocomplete; + AutoComplete *const m_autocomplete; }; #endif // AUTOCOMPLETESETTINGSEDITOR_H diff --git a/examples/checkboxsettingseditor.cpp b/examples/checkboxsettingseditor.cpp index 2e4037dd3..6ade78ca9 100644 --- a/examples/checkboxsettingseditor.cpp +++ b/examples/checkboxsettingseditor.cpp @@ -1,12 +1,9 @@ #include "checkboxsettingseditor.h" -#include -#include -#include CheckBoxSettingsEditor::CheckBoxSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::CheckBoxSettingsForm), - m_checkBox(new QtMaterialCheckBox) + m_checkBox(new CheckBox) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); @@ -52,10 +49,10 @@ void CheckBoxSettingsEditor::setupForm() { switch (m_checkBox->labelPosition()) { - case QtMaterialCheckable::LabelPositionLeft: + case Checkable::LabelPositionLeft: ui->labelPositionComboBox->setCurrentIndex(0); break; - case QtMaterialCheckable::LabelPositionRight: + case Checkable::LabelPositionRight: ui->labelPositionComboBox->setCurrentIndex(1); break; default: @@ -73,10 +70,10 @@ void CheckBoxSettingsEditor::updateWidget() switch (ui->labelPositionComboBox->currentIndex()) { case 0: - m_checkBox->setLabelPosition(QtMaterialCheckable::LabelPositionLeft); + m_checkBox->setLabelPosition(Checkable::LabelPositionLeft); break; case 1: - m_checkBox->setLabelPosition(QtMaterialCheckable::LabelPositionRight); + m_checkBox->setLabelPosition(Checkable::LabelPositionRight); break; default: break; diff --git a/examples/checkboxsettingseditor.h b/examples/checkboxsettingseditor.h index 445636790..ac0f19ad6 100644 --- a/examples/checkboxsettingseditor.h +++ b/examples/checkboxsettingseditor.h @@ -2,9 +2,14 @@ #define CHECKBOXSETTINGSEDITOR_H #include +#include +#include + +#include + #include "ui_checkboxsettingsform.h" -class QtMaterialCheckable; +using namespace md; class CheckBoxSettingsEditor : public QWidget { @@ -21,7 +26,7 @@ protected slots: private: Ui::CheckBoxSettingsForm *const ui; - QtMaterialCheckable *const m_checkBox; + Checkable *const m_checkBox; }; #endif // CHECKBOXSETTINGSEDITOR_H diff --git a/examples/circularprogresssettingseditor.cpp b/examples/circularprogresssettingseditor.cpp index 8c049fcd7..976f962db 100644 --- a/examples/circularprogresssettingseditor.cpp +++ b/examples/circularprogresssettingseditor.cpp @@ -1,12 +1,9 @@ #include "circularprogresssettingseditor.h" -#include -#include -#include CircularProgressSettingsEditor::CircularProgressSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::CircularProgressSettingsForm), - m_progress(new QtMaterialCircularProgress) + m_progress(new CircularProgress) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); diff --git a/examples/circularprogresssettingseditor.h b/examples/circularprogresssettingseditor.h index 507798969..e008fff4d 100644 --- a/examples/circularprogresssettingseditor.h +++ b/examples/circularprogresssettingseditor.h @@ -2,9 +2,14 @@ #define CIRCULARPROGRESSSETTINGSEDITOR_H #include +#include +#include + +#include + #include "ui_circularprogresssettingsform.h" -class QtMaterialCircularProgress; +using namespace md; class CircularProgressSettingsEditor : public QWidget { @@ -21,7 +26,7 @@ protected slots: private: Ui::CircularProgressSettingsForm *const ui; - QtMaterialCircularProgress *const m_progress; + CircularProgress *const m_progress; }; #endif // CIRCULARPROGRESSSETTINGSEDITOR_H diff --git a/examples/dialogsettingseditor.cpp b/examples/dialogsettingseditor.cpp index f4e4916ae..8b350dd27 100644 --- a/examples/dialogsettingseditor.cpp +++ b/examples/dialogsettingseditor.cpp @@ -1,13 +1,9 @@ #include "dialogsettingseditor.h" -#include -#include -#include -#include DialogSettingsEditor::DialogSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::DialogSettingsForm), - m_dialog(new QtMaterialDialog) + m_dialog(new Dialog) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); @@ -32,7 +28,7 @@ DialogSettingsEditor::DialogSettingsEditor(QWidget *parent) QVBoxLayout *dialogWidgetLayout = new QVBoxLayout; dialogWidget->setLayout(dialogWidgetLayout); - QtMaterialFlatButton *closeButton = new QtMaterialFlatButton("Close"); + FlatButton *closeButton = new FlatButton("Close"); dialogWidgetLayout->addWidget(closeButton); dialogWidgetLayout->setAlignment(closeButton, Qt::AlignBottom | Qt::AlignCenter); diff --git a/examples/dialogsettingseditor.h b/examples/dialogsettingseditor.h index f92204621..1de0de4c7 100644 --- a/examples/dialogsettingseditor.h +++ b/examples/dialogsettingseditor.h @@ -2,9 +2,15 @@ #define DIALOGSETTINGSEDITOR_H #include +#include +#include +#include + +#include + #include "ui_dialogsettingsform.h" -class QtMaterialDialog; +using namespace md; class DialogSettingsEditor : public QWidget { @@ -20,7 +26,7 @@ protected slots: private: Ui::DialogSettingsForm *const ui; - QtMaterialDialog *const m_dialog; + Dialog *const m_dialog; }; #endif // DIALOGSETTINGSEDITOR_H diff --git a/examples/drawersettingseditor.cpp b/examples/drawersettingseditor.cpp index dc515b75a..f9b2d71f7 100644 --- a/examples/drawersettingseditor.cpp +++ b/examples/drawersettingseditor.cpp @@ -1,12 +1,9 @@ #include "drawersettingseditor.h" -#include -#include -#include DrawerSettingsEditor::DrawerSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::DrawerSettingsForm), - m_drawer(new QtMaterialDrawer) + m_drawer(new Drawer) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); diff --git a/examples/drawersettingseditor.h b/examples/drawersettingseditor.h index 45f21af1f..0c5786474 100644 --- a/examples/drawersettingseditor.h +++ b/examples/drawersettingseditor.h @@ -2,9 +2,14 @@ #define DRAWERSETTINGSEDITOR_H #include +#include +#include + +#include + #include "ui_drawersettingsform.h" -class QtMaterialDrawer; +using namespace md; class DrawerSettingsEditor : public QWidget { @@ -20,7 +25,7 @@ protected slots: private: Ui::DrawerSettingsForm *const ui; - QtMaterialDrawer *const m_drawer; + Drawer *const m_drawer; }; #endif // DRAWERSETTINGSEDITOR_H diff --git a/examples/fabsettingseditor.cpp b/examples/fabsettingseditor.cpp index efbceed64..cc5c54094 100644 --- a/examples/fabsettingseditor.cpp +++ b/examples/fabsettingseditor.cpp @@ -1,13 +1,9 @@ #include "fabsettingseditor.h" -#include -#include -#include -#include FloatingActionButtonSettingsEditor::FloatingActionButtonSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::FloatingActionButtonSettingsForm), - m_fab(new QtMaterialFloatingActionButton(QtMaterialTheme::icon("toggle", "star"))) + m_fab(new FloatingActionButton(Theme::icon("toggle", "star"))) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); diff --git a/examples/fabsettingseditor.h b/examples/fabsettingseditor.h index 2d815f41e..897303916 100644 --- a/examples/fabsettingseditor.h +++ b/examples/fabsettingseditor.h @@ -2,9 +2,15 @@ #define FABSETTINGSEDITOR_H #include +#include +#include +#include + +#include + #include "ui_fabsettingsform.h" -class QtMaterialFloatingActionButton; +using namespace md; class FloatingActionButtonSettingsEditor : public QWidget { @@ -21,7 +27,7 @@ protected slots: private: Ui::FloatingActionButtonSettingsForm *const ui; - QtMaterialFloatingActionButton *const m_fab; + FloatingActionButton *const m_fab; }; #endif // FABSETTINGSEDITOR_H diff --git a/examples/flatbuttonsettingseditor.cpp b/examples/flatbuttonsettingseditor.cpp index 6b620ccc5..eaf1723c7 100644 --- a/examples/flatbuttonsettingseditor.cpp +++ b/examples/flatbuttonsettingseditor.cpp @@ -1,12 +1,9 @@ #include "flatbuttonsettingseditor.h" -#include -#include -#include FlatButtonSettingsEditor::FlatButtonSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::FlatButtonSettingsForm), - m_button(new QtMaterialFlatButton("I'm flat")) + m_button(new FlatButton("I'm flat")) { init(); } @@ -16,7 +13,7 @@ FlatButtonSettingsEditor::~FlatButtonSettingsEditor() delete ui; } -FlatButtonSettingsEditor::FlatButtonSettingsEditor(QtMaterialFlatButton *button, QWidget *parent) +FlatButtonSettingsEditor::FlatButtonSettingsEditor(FlatButton *button, QWidget *parent) : QWidget(parent), ui(new Ui::FlatButtonSettingsForm), m_button(button) @@ -180,7 +177,7 @@ void FlatButtonSettingsEditor::updateWidget() m_button->setCheckable(ui->checkableCheckBox->isChecked()); m_button->setChecked(ui->checkedCheckBox->isChecked()); m_button->setHaloVisible(ui->showHaloCheckBox->isChecked()); - m_button->setIcon(ui->iconCheckBox->isChecked() ? QtMaterialTheme::icon("toggle", "star") + m_button->setIcon(ui->iconCheckBox->isChecked() ? Theme::icon("toggle", "star") : QIcon()); m_button->setUseThemeColors(ui->useThemeColorsCheckBox->isChecked()); m_button->setBackgroundMode(ui->transparentCheckBox->isChecked() diff --git a/examples/flatbuttonsettingseditor.h b/examples/flatbuttonsettingseditor.h index 0ec4fd273..044ac99d8 100644 --- a/examples/flatbuttonsettingseditor.h +++ b/examples/flatbuttonsettingseditor.h @@ -2,9 +2,14 @@ #define FLATBUTTONSETTINGSMANAGER_H #include +#include +#include + +#include + #include "ui_flatbuttonsettingsform.h" -class QtMaterialFlatButton; +using namespace md; class FlatButtonSettingsEditor : public QWidget { @@ -15,7 +20,7 @@ class FlatButtonSettingsEditor : public QWidget ~FlatButtonSettingsEditor(); protected: - explicit FlatButtonSettingsEditor(QtMaterialFlatButton *button, QWidget *parent = 0); + explicit FlatButtonSettingsEditor(FlatButton *button, QWidget *parent = 0); Ui::FlatButtonSettingsForm *const ui; @@ -29,7 +34,7 @@ protected slots: private: void init(); - QtMaterialFlatButton *const m_button; + FlatButton *const m_button; }; #endif // FLATBUTTONSETTINGSMANAGER_H diff --git a/examples/iconbuttonsettingseditor.cpp b/examples/iconbuttonsettingseditor.cpp index aba4bc1b8..4a67ca4cd 100644 --- a/examples/iconbuttonsettingseditor.cpp +++ b/examples/iconbuttonsettingseditor.cpp @@ -1,12 +1,9 @@ #include "iconbuttonsettingseditor.h" -#include -#include -#include IconButtonSettingsEditor::IconButtonSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::IconButtonSettingsForm), - m_button(new QtMaterialIconButton(Theme::icon("toggle", "star"))) + m_button(new IconButton(Theme::icon("toggle", "star"))) { init(); } diff --git a/examples/iconbuttonsettingseditor.h b/examples/iconbuttonsettingseditor.h index d8758f85b..275f2e2b5 100644 --- a/examples/iconbuttonsettingseditor.h +++ b/examples/iconbuttonsettingseditor.h @@ -2,9 +2,14 @@ #define ICONBUTTONSETTINGSMANAGER_H #include +#include + +#include +#include + #include "ui_iconbuttonsettingsform.h" -class QtMaterialIconButton; +using namespace md; class IconButtonSettingsEditor : public QWidget { @@ -15,7 +20,7 @@ class IconButtonSettingsEditor : public QWidget ~IconButtonSettingsEditor(); protected: - explicit IconButtonSettingsEditor(QtMaterialIconButton *button, QWidget *parent = 0); + explicit IconButtonSettingsEditor(IconButton *button, QWidget *parent = 0); Ui::IconButtonSettingsForm *const ui; @@ -27,7 +32,7 @@ protected slots: private: void init(); - QtMaterialIconButton *const m_button; + IconButton *const m_button; }; #endif // ICONBUTTONSETTINGSMANAGER_H diff --git a/examples/mainwindow.cpp b/examples/mainwindow.cpp index cc45106d5..3567e1b66 100644 --- a/examples/mainwindow.cpp +++ b/examples/mainwindow.cpp @@ -21,70 +21,70 @@ MainWindow::MainWindow(QWidget *parent) AvatarSettingsEditor *avatar = new AvatarSettingsEditor; BadgeSettingsEditor *badge = new BadgeSettingsEditor; -// CheckBoxSettingsEditor *checkbox = new CheckBoxSettingsEditor; -// FloatingActionButtonSettingsEditor *fab = new FloatingActionButtonSettingsEditor; -// RaisedButtonSettingsEditor *raisedButton = new RaisedButtonSettingsEditor; -// FlatButtonSettingsEditor *flatButton = new FlatButtonSettingsEditor; -// IconButtonSettingsEditor *iconButton = new IconButtonSettingsEditor; -// ProgressSettingsEditor *progress = new ProgressSettingsEditor; -// CircularProgressSettingsEditor *circularProgress = new CircularProgressSettingsEditor; -// SliderSettingsEditor *slider = new SliderSettingsEditor; -// RadioButtonSettingsEditor *radioButton = new RadioButtonSettingsEditor; -// ToggleSettingsEditor *toggle = new ToggleSettingsEditor; -// TextFieldSettingsEditor *textField = new TextFieldSettingsEditor; -// TabsSettingsEditor *tabs = new TabsSettingsEditor; -// SnackbarSettingsEditor *snackbar = new SnackbarSettingsEditor; -// DialogSettingsEditor *dialog = new DialogSettingsEditor; -// DrawerSettingsEditor *drawer = new DrawerSettingsEditor; -// ScrollBarSettingsEditor *scrollBar = new ScrollBarSettingsEditor; + CheckBoxSettingsEditor *checkbox = new CheckBoxSettingsEditor; + FloatingActionButtonSettingsEditor *fab = new FloatingActionButtonSettingsEditor; + RaisedButtonSettingsEditor *raisedButton = new RaisedButtonSettingsEditor; + FlatButtonSettingsEditor *flatButton = new FlatButtonSettingsEditor; + IconButtonSettingsEditor *iconButton = new IconButtonSettingsEditor; + ProgressSettingsEditor *progress = new ProgressSettingsEditor; + CircularProgressSettingsEditor *circularProgress = new CircularProgressSettingsEditor; + SliderSettingsEditor *slider = new SliderSettingsEditor; + RadioButtonSettingsEditor *radioButton = new RadioButtonSettingsEditor; + ToggleSettingsEditor *toggle = new ToggleSettingsEditor; + TextFieldSettingsEditor *textField = new TextFieldSettingsEditor; + TabsSettingsEditor *tabs = new TabsSettingsEditor; + SnackbarSettingsEditor *snackbar = new SnackbarSettingsEditor; + DialogSettingsEditor *dialog = new DialogSettingsEditor; + DrawerSettingsEditor *drawer = new DrawerSettingsEditor; + ScrollBarSettingsEditor *scrollBar = new ScrollBarSettingsEditor; AppBarSettingsEditor *appBar = new AppBarSettingsEditor; -// AutoCompleteSettingsEditor *autocomplete = new AutoCompleteSettingsEditor; -// MenuSettingsEditor *menu = new MenuSettingsEditor; + AutoCompleteSettingsEditor *autocomplete = new AutoCompleteSettingsEditor; + MenuSettingsEditor *menu = new MenuSettingsEditor; stack->addWidget(avatar); stack->addWidget(appBar); -// stack->addWidget(autocomplete); + stack->addWidget(autocomplete); stack->addWidget(badge); -// stack->addWidget(checkbox); -// stack->addWidget(circularProgress); -// stack->addWidget(dialog); -// stack->addWidget(drawer); -// stack->addWidget(fab); -// stack->addWidget(flatButton); -// stack->addWidget(iconButton); -// stack->addWidget(menu); -// stack->addWidget(progress); -// stack->addWidget(radioButton); -// stack->addWidget(raisedButton); -// stack->addWidget(scrollBar); -// stack->addWidget(slider); -// stack->addWidget(snackbar); -// stack->addWidget(tabs); -// stack->addWidget(textField); -// stack->addWidget(toggle); + stack->addWidget(checkbox); + stack->addWidget(circularProgress); + stack->addWidget(dialog); + stack->addWidget(drawer); + stack->addWidget(fab); + stack->addWidget(flatButton); + stack->addWidget(iconButton); + stack->addWidget(menu); + stack->addWidget(progress); + stack->addWidget(radioButton); + stack->addWidget(raisedButton); + stack->addWidget(scrollBar); + stack->addWidget(slider); + stack->addWidget(snackbar); + stack->addWidget(tabs); + stack->addWidget(textField); + stack->addWidget(toggle); list->addItem("Avatar"); list->addItem("App Bar"); -// list->addItem("Auto Complete"); + list->addItem("Auto Complete"); list->addItem("Badge"); -// list->addItem("Checkbox"); -// list->addItem("Circular Progress"); -// list->addItem("Dialog"); -// list->addItem("Drawer"); -// list->addItem("Floating Action Button"); -// list->addItem("Flat Button"); -// list->addItem("Icon Button"); -// list->addItem("Menu"); -// list->addItem("Progress"); -// list->addItem("Radio Button"); -// list->addItem("Raised Button"); -// list->addItem("ScrollBar"); -// list->addItem("Slider"); -// list->addItem("Snackbar"); -// list->addItem("Tabs"); -// list->addItem("Text Field"); -// list->addItem("Toggle"); + list->addItem("Checkbox"); + list->addItem("Circular Progress"); + list->addItem("Dialog"); + list->addItem("Drawer"); + list->addItem("Floating Action Button"); + list->addItem("Flat Button"); + list->addItem("Icon Button"); + list->addItem("Menu"); + list->addItem("Progress"); + list->addItem("Radio Button"); + list->addItem("Raised Button"); + list->addItem("ScrollBar"); + list->addItem("Slider"); + list->addItem("Snackbar"); + list->addItem("Tabs"); + list->addItem("Text Field"); + list->addItem("Toggle"); list->setCurrentRow(0); diff --git a/examples/mainwindow.h b/examples/mainwindow.h index 955035684..eaf1c9bbe 100644 --- a/examples/mainwindow.h +++ b/examples/mainwindow.h @@ -8,25 +8,25 @@ #include "avatarsettingseditor.h" #include "badgesettingseditor.h" -//#include "checkboxsettingseditor.h" -//#include "fabsettingseditor.h" -//#include "raisedbuttonsettingseditor.h" -//#include "flatbuttonsettingseditor.h" -//#include "iconbuttonsettingseditor.h" -//#include "progresssettingseditor.h" -//#include "circularprogresssettingseditor.h" -//#include "slidersettingseditor.h" -//#include "radiobuttonsettingseditor.h" -//#include "togglesettingseditor.h" -//#include "textfieldsettingseditor.h" -//#include "tabssettingseditor.h" -//#include "snackbarsettingseditor.h" -//#include "dialogsettingseditor.h" -//#include "drawersettingseditor.h" -//#include "scrollbarsettingseditor.h" +#include "checkboxsettingseditor.h" +#include "fabsettingseditor.h" +#include "raisedbuttonsettingseditor.h" +#include "flatbuttonsettingseditor.h" +#include "iconbuttonsettingseditor.h" +#include "progresssettingseditor.h" +#include "circularprogresssettingseditor.h" +#include "slidersettingseditor.h" +#include "radiobuttonsettingseditor.h" +#include "togglesettingseditor.h" +#include "textfieldsettingseditor.h" +#include "tabssettingseditor.h" +#include "snackbarsettingseditor.h" +#include "dialogsettingseditor.h" +#include "drawersettingseditor.h" +#include "scrollbarsettingseditor.h" #include "appbarsettingseditor.h" -//#include "autocompletesettingseditor.h" -//#include "menusettingseditor.h" +#include "autocompletesettingseditor.h" +#include "menusettingseditor.h" class MainWindow : public QMainWindow { diff --git a/examples/menusettingseditor.cpp b/examples/menusettingseditor.cpp index fcf5c6579..e406feb37 100644 --- a/examples/menusettingseditor.cpp +++ b/examples/menusettingseditor.cpp @@ -1,12 +1,9 @@ #include "menusettingseditor.h" -#include -#include -#include MenuSettingsEditor::MenuSettingsEditor(QWidget *parent) : QWidget(parent), //ui(new Ui::MenuSettingsForm), - m_menu(new QtMaterialMenu) + m_menu(new Menu) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); diff --git a/examples/menusettingseditor.h b/examples/menusettingseditor.h index bed5c41f3..d6ecc431c 100644 --- a/examples/menusettingseditor.h +++ b/examples/menusettingseditor.h @@ -2,11 +2,15 @@ #define MENUSETTINGSEDITOR_H #include -//#include "ui_menusettingsform.h" +#include +#include +#include #include "lib/qtmaterialoverlaywidget.h" -class QtMaterialMenu; +//#include "ui_menusettingsform.h" + +using namespace md; class MenuSettingsEditor : public QWidget { @@ -23,7 +27,7 @@ protected slots: private: //Ui::MenuSettingsForm *const ui; - QtMaterialMenu *const m_menu; + Menu *const m_menu; }; #endif // MENUSETTINGSEDITOR_H diff --git a/examples/progresssettingseditor.cpp b/examples/progresssettingseditor.cpp index 401eb5770..57e5cde34 100644 --- a/examples/progresssettingseditor.cpp +++ b/examples/progresssettingseditor.cpp @@ -1,12 +1,9 @@ #include "progresssettingseditor.h" -#include -#include -#include ProgressSettingsEditor::ProgressSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::ProgressSettingsForm), - m_progress(new QtMaterialProgress) + m_progress(new ProgressBar) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); diff --git a/examples/progresssettingseditor.h b/examples/progresssettingseditor.h index bc5bbaa5b..fcd63172c 100644 --- a/examples/progresssettingseditor.h +++ b/examples/progresssettingseditor.h @@ -2,9 +2,14 @@ #define PROGRESSSETTINGSEDITOR_H #include +#include + +#include +#include + #include "ui_progresssettingsform.h" -class QtMaterialProgress; +using namespace md; class ProgressSettingsEditor : public QWidget { @@ -21,7 +26,7 @@ protected slots: private: Ui::ProgressSettingsForm *const ui; - QtMaterialProgress *const m_progress; + ProgressBar *const m_progress; }; #endif // PROGRESSSETTINGSEDITOR_H diff --git a/examples/radiobuttonsettingseditor.cpp b/examples/radiobuttonsettingseditor.cpp index 2a039ce50..51b1129a8 100644 --- a/examples/radiobuttonsettingseditor.cpp +++ b/examples/radiobuttonsettingseditor.cpp @@ -1,15 +1,11 @@ #include "radiobuttonsettingseditor.h" -#include -#include -#include -#include RadioButtonSettingsEditor::RadioButtonSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::RadioButtonSettingsForm), - m_radioButton1(new QtMaterialRadioButton), - m_radioButton2(new QtMaterialRadioButton), - m_radioButton3(new QtMaterialRadioButton) + m_radioButton1(new RadioButton), + m_radioButton2(new RadioButton), + m_radioButton3(new RadioButton) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); @@ -47,7 +43,7 @@ RadioButtonSettingsEditor::RadioButtonSettingsEditor(QWidget *parent) layout->setAlignment(Qt::AlignCenter); - layout->setMargin(0); +// layout->setMargin(0); // FIXME: ??? layout->setSpacing(0); setupForm(); @@ -72,10 +68,10 @@ void RadioButtonSettingsEditor::setupForm() { switch (m_radioButton1->labelPosition()) { - case QtMaterialCheckable::LabelPositionLeft: + case Checkable::LabelPositionLeft: ui->labelPositionComboBox_2->setCurrentIndex(0); break; - case QtMaterialCheckable::LabelPositionRight: + case Checkable::LabelPositionRight: ui->labelPositionComboBox_2->setCurrentIndex(1); break; default: @@ -92,14 +88,14 @@ void RadioButtonSettingsEditor::updateWidget() switch (ui->labelPositionComboBox_2->currentIndex()) { case 0: - m_radioButton1->setLabelPosition(QtMaterialCheckable::LabelPositionLeft); - m_radioButton2->setLabelPosition(QtMaterialCheckable::LabelPositionLeft); - m_radioButton3->setLabelPosition(QtMaterialCheckable::LabelPositionLeft); + m_radioButton1->setLabelPosition(Checkable::LabelPositionLeft); + m_radioButton2->setLabelPosition(Checkable::LabelPositionLeft); + m_radioButton3->setLabelPosition(Checkable::LabelPositionLeft); break; case 1: - m_radioButton1->setLabelPosition(QtMaterialCheckable::LabelPositionRight); - m_radioButton2->setLabelPosition(QtMaterialCheckable::LabelPositionRight); - m_radioButton3->setLabelPosition(QtMaterialCheckable::LabelPositionRight); + m_radioButton1->setLabelPosition(Checkable::LabelPositionRight); + m_radioButton2->setLabelPosition(Checkable::LabelPositionRight); + m_radioButton3->setLabelPosition(Checkable::LabelPositionRight); break; default: break; diff --git a/examples/radiobuttonsettingseditor.h b/examples/radiobuttonsettingseditor.h index 76ad852b4..3625a175d 100644 --- a/examples/radiobuttonsettingseditor.h +++ b/examples/radiobuttonsettingseditor.h @@ -2,10 +2,15 @@ #define RADIOBUTTONSETTINGSEDITOR_H #include +#include +#include +#include + +#include + #include "ui_radiobuttonsettingsform.h" -class QtMaterialRadioButton; -class RadioButton; +using namespace md; class RadioButtonSettingsEditor : public QWidget { @@ -22,9 +27,9 @@ protected slots: private: Ui::RadioButtonSettingsForm *const ui; - QtMaterialRadioButton *const m_radioButton1; - QtMaterialRadioButton *const m_radioButton2; - QtMaterialRadioButton *const m_radioButton3; + RadioButton *const m_radioButton1; + RadioButton *const m_radioButton2; + RadioButton *const m_radioButton3; }; #endif // RADIOBUTTONSETTINGSEDITOR_H diff --git a/examples/raisedbuttonsettingseditor.cpp b/examples/raisedbuttonsettingseditor.cpp index 3dc41e00e..fc79b2e0a 100644 --- a/examples/raisedbuttonsettingseditor.cpp +++ b/examples/raisedbuttonsettingseditor.cpp @@ -1,8 +1,7 @@ #include "raisedbuttonsettingseditor.h" -#include RaisedButtonSettingsEditor::RaisedButtonSettingsEditor(QWidget *parent) - : FlatButtonSettingsEditor(new QtMaterialRaisedButton("Rise up"), parent) + : FlatButtonSettingsEditor(new RaisedButton("Rise up"), parent) { ui->transparentCheckBox->setDisabled(true); ui->defaultPresetPushButton->setDisabled(true); diff --git a/examples/raisedbuttonsettingseditor.h b/examples/raisedbuttonsettingseditor.h index 250acd07e..225292e52 100644 --- a/examples/raisedbuttonsettingseditor.h +++ b/examples/raisedbuttonsettingseditor.h @@ -1,8 +1,11 @@ #ifndef RAISEDBUTTONSETTINGSEDITOR_H #define RAISEDBUTTONSETTINGSEDITOR_H +#include #include "flatbuttonsettingseditor.h" +using namespace md; + class RaisedButtonSettingsEditor : public FlatButtonSettingsEditor { Q_OBJECT diff --git a/examples/scrollbarsettingseditor.cpp b/examples/scrollbarsettingseditor.cpp index b02944c32..fdd5d81a8 100644 --- a/examples/scrollbarsettingseditor.cpp +++ b/examples/scrollbarsettingseditor.cpp @@ -1,14 +1,10 @@ #include "scrollbarsettingseditor.h" -#include -#include -#include -#include ScrollBarSettingsEditor::ScrollBarSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::ScrollBarSettingsForm), - m_verticalScrollbar(new QtMaterialScrollBar), - m_horizontalScrollbar(new QtMaterialScrollBar) + m_verticalScrollbar(new ScrollBar), + m_horizontalScrollbar(new ScrollBar) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); diff --git a/examples/scrollbarsettingseditor.h b/examples/scrollbarsettingseditor.h index fd7453957..971d12e4d 100644 --- a/examples/scrollbarsettingseditor.h +++ b/examples/scrollbarsettingseditor.h @@ -2,9 +2,15 @@ #define SCROLLBARSETTINGSEDITOR_H #include +#include +#include +#include + +#include + #include "ui_scrollbarsettingsform.h" -class QtMaterialScrollBar; +using namespace md; class ScrollBarSettingsEditor : public QWidget { @@ -20,8 +26,8 @@ protected slots: private: Ui::ScrollBarSettingsForm *const ui; - QtMaterialScrollBar *const m_verticalScrollbar; - QtMaterialScrollBar *const m_horizontalScrollbar; + ScrollBar *const m_verticalScrollbar; + ScrollBar *const m_horizontalScrollbar; }; #endif // SCROLLBARSETTINGSEDITOR_H diff --git a/examples/slidersettingseditor.cpp b/examples/slidersettingseditor.cpp index 2911fdb7b..fd3ca735c 100644 --- a/examples/slidersettingseditor.cpp +++ b/examples/slidersettingseditor.cpp @@ -1,12 +1,9 @@ #include "slidersettingseditor.h" -#include -#include -#include SliderSettingsEditor::SliderSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::SliderSettingsForm), - m_slider(new QtMaterialSlider) + m_slider(new Slider) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); diff --git a/examples/slidersettingseditor.h b/examples/slidersettingseditor.h index 11e1a851f..fdd3d9f6a 100644 --- a/examples/slidersettingseditor.h +++ b/examples/slidersettingseditor.h @@ -2,9 +2,14 @@ #define SLIDERSETTINGSEDITOR_H #include +#include +#include + +#include + #include "ui_slidersettingsform.h" -class QtMaterialSlider; +using namespace md; class SliderSettingsEditor : public QWidget { @@ -20,7 +25,7 @@ protected slots: private: Ui::SliderSettingsForm *const ui; - QtMaterialSlider *const m_slider; + Slider *const m_slider; }; #endif // SLIDERSETTINGSEDITOR_H diff --git a/examples/snackbarsettingseditor.cpp b/examples/snackbarsettingseditor.cpp index 0a9dcca3a..bd348646b 100644 --- a/examples/snackbarsettingseditor.cpp +++ b/examples/snackbarsettingseditor.cpp @@ -1,12 +1,9 @@ #include "snackbarsettingseditor.h" -#include -#include -#include SnackbarSettingsEditor::SnackbarSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::SnackbarSettingsForm), - m_snackbar(new QtMaterialSnackbar) + m_snackbar(new SnackBar) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); diff --git a/examples/snackbarsettingseditor.h b/examples/snackbarsettingseditor.h index 2e4eb0d95..e51c163df 100644 --- a/examples/snackbarsettingseditor.h +++ b/examples/snackbarsettingseditor.h @@ -2,9 +2,14 @@ #define SNACKBARSETTINGSEDITOR_H #include +#include +#include + +#include + #include "ui_snackbarsettingsform.h" -class QtMaterialSnackbar; +using namespace md; class SnackbarSettingsEditor : public QWidget { @@ -21,7 +26,7 @@ protected slots: private: Ui::SnackbarSettingsForm *const ui; - QtMaterialSnackbar *const m_snackbar; + SnackBar *const m_snackbar; }; #endif // SNACKBARSETTINGSEDITOR_H diff --git a/examples/tabssettingseditor.cpp b/examples/tabssettingseditor.cpp index 9b53a1d78..04f4c299a 100644 --- a/examples/tabssettingseditor.cpp +++ b/examples/tabssettingseditor.cpp @@ -1,12 +1,9 @@ #include "tabssettingseditor.h" -#include -#include -#include TabsSettingsEditor::TabsSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::TabsSettingsForm), - m_tabs(new QtMaterialTabs) + m_tabs(new Tabs) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); diff --git a/examples/tabssettingseditor.h b/examples/tabssettingseditor.h index 7bf3e9785..806a4cdb6 100644 --- a/examples/tabssettingseditor.h +++ b/examples/tabssettingseditor.h @@ -2,9 +2,14 @@ #define TABSSETTINGSEDITOR_H #include +#include +#include + +#include + #include "ui_tabssettingsform.h" -class QtMaterialTabs; +using namespace md; class TabsSettingsEditor : public QWidget { @@ -20,7 +25,7 @@ protected slots: private: Ui::TabsSettingsForm *const ui; - QtMaterialTabs *const m_tabs; + Tabs *const m_tabs; }; #endif // TABSSETTINGSEDITOR_H diff --git a/examples/textfieldsettingseditor.cpp b/examples/textfieldsettingseditor.cpp index 2b7fa8d79..d56a085c9 100644 --- a/examples/textfieldsettingseditor.cpp +++ b/examples/textfieldsettingseditor.cpp @@ -1,12 +1,9 @@ #include "textfieldsettingseditor.h" -#include -#include -#include TextFieldSettingsEditor::TextFieldSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::TextFieldSettingsForm), - m_textField(new QtMaterialTextField) + m_textField(new TextField) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); diff --git a/examples/textfieldsettingseditor.h b/examples/textfieldsettingseditor.h index 57f0d0f3f..cc01a1c8d 100644 --- a/examples/textfieldsettingseditor.h +++ b/examples/textfieldsettingseditor.h @@ -2,9 +2,14 @@ #define TEXTFIELDSETTINGSEDITOR_H #include +#include +#include + +#include + #include "ui_textfieldsettingsform.h" -class QtMaterialTextField; +using namespace md; class TextFieldSettingsEditor : public QWidget { @@ -22,7 +27,7 @@ protected slots: private: Ui::TextFieldSettingsForm *const ui; - QtMaterialTextField *const m_textField; + TextField *const m_textField; }; #endif // TEXTFIELDSETTINGSEDITOR_H diff --git a/examples/togglesettingseditor.cpp b/examples/togglesettingseditor.cpp index 36fe97822..39d51bc46 100644 --- a/examples/togglesettingseditor.cpp +++ b/examples/togglesettingseditor.cpp @@ -1,11 +1,9 @@ #include "togglesettingseditor.h" -#include -#include ToggleSettingsEditor::ToggleSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::ToggleSettingsForm), - m_toggle(new QtMaterialToggle) + m_toggle(new Toggle) { QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); diff --git a/examples/togglesettingseditor.h b/examples/togglesettingseditor.h index a74553e47..435c76c2b 100644 --- a/examples/togglesettingseditor.h +++ b/examples/togglesettingseditor.h @@ -2,9 +2,13 @@ #define TOGGLESETTINGSEDITOR_H #include +#include + +#include + #include "ui_togglesettingsform.h" -class QtMaterialToggle; +using namespace md; class ToggleSettingsEditor : public QWidget { @@ -21,7 +25,7 @@ protected slots: private: Ui::ToggleSettingsForm *const ui; - QtMaterialToggle *const m_toggle; + Toggle *const m_toggle; }; #endif // TOGGLESETTINGSEDITOR_H From f1f696c5dce82399559224a7507c941593553ed6 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 16:17:19 +0100 Subject: [PATCH 39/46] Class name matches the file name. --- components/CMakeLists.txt | 248 +++++++++--------- .../{qtmaterialappbar.cpp => appbar.cpp} | 6 +- components/{qtmaterialappbar.h => appbar.h} | 6 +- .../{qtmaterialappbar_p.h => appbar_p.h} | 6 +- ...erialautocomplete.cpp => autocomplete.cpp} | 2 +- ...tmaterialautocomplete.h => autocomplete.h} | 8 +- ...internal.cpp => autocomplete_internal.cpp} | 2 +- ...ete_internal.h => autocomplete_internal.h} | 8 +- ...erialautocomplete_p.h => autocomplete_p.h} | 14 +- .../{qtmaterialavatar.cpp => avatar.cpp} | 6 +- components/{qtmaterialavatar.h => avatar.h} | 8 +- .../{qtmaterialavatar_p.h => avatar_p.h} | 8 +- components/{qtmaterialbadge.cpp => badge.cpp} | 6 +- components/{qtmaterialbadge.h => badge.h} | 8 +- components/{qtmaterialbadge_p.h => badge_p.h} | 6 +- .../{qtmaterialcheckbox.cpp => checkbox.cpp} | 2 +- .../{qtmaterialcheckbox.h => checkbox.h} | 8 +- .../{qtmaterialcheckbox_p.h => checkbox_p.h} | 12 +- ...cularprogress.cpp => circularprogress.cpp} | 8 +- ...lcircularprogress.h => circularprogress.h} | 8 +- ...rnal.cpp => circularprogress_internal.cpp} | 2 +- ...internal.h => circularprogress_internal.h} | 8 +- ...cularprogress_p.h => circularprogress_p.h} | 8 +- .../{qtmaterialdialog.cpp => dialog.cpp} | 2 +- components/{qtmaterialdialog.h => dialog.h} | 14 +- ...ialog_internal.cpp => dialog_internal.cpp} | 2 +- ...ialdialog_internal.h => dialog_internal.h} | 8 +- .../{qtmaterialdialog_p.h => dialog_p.h} | 6 +- .../{qtmaterialdrawer.cpp => drawer.cpp} | 2 +- components/{qtmaterialdrawer.h => drawer.h} | 12 +- ...rawer_internal.cpp => drawer_internal.cpp} | 4 +- ...ialdrawer_internal.h => drawer_internal.h} | 2 +- .../{qtmaterialdrawer_p.h => drawer_p.h} | 0 components/{qtmaterialfab.cpp => fab.cpp} | 6 +- components/{qtmaterialfab.h => fab.h} | 8 +- components/{qtmaterialfab_p.h => fab_p.h} | 8 +- ...tmaterialflatbutton.cpp => flatbutton.cpp} | 12 +- .../{qtmaterialflatbutton.h => flatbutton.h} | 8 +- ...n_internal.cpp => flatbutton_internal.cpp} | 2 +- ...utton_internal.h => flatbutton_internal.h} | 10 +- ...tmaterialflatbutton_p.h => flatbutton_p.h} | 8 +- ...tmaterialiconbutton.cpp => iconbutton.cpp} | 8 +- .../{qtmaterialiconbutton.h => iconbutton.h} | 6 +- ...tmaterialiconbutton_p.h => iconbutton_p.h} | 6 +- components/layouts/qtmaterialsnackbarlayout.h | 7 - .../layouts/qtmaterialsnackbarlayout_p.h | 7 - ...lsnackbarlayout.cpp => snackbarlayout.cpp} | 0 components/layouts/snackbarlayout.h | 7 + components/layouts/snackbarlayout_p.h | 7 + ...{qtmaterialcheckable.cpp => checkable.cpp} | 12 +- .../{qtmaterialcheckable.h => checkable.h} | 6 +- ...le_internal.cpp => checkable_internal.cpp} | 4 +- ...ckable_internal.h => checkable_internal.h} | 6 +- ...{qtmaterialcheckable_p.h => checkable_p.h} | 8 +- ...ialoverlaywidget.cpp => overlaywidget.cpp} | 2 +- ...aterialoverlaywidget.h => overlaywidget.h} | 6 +- .../lib/{qtmaterialripple.cpp => ripple.cpp} | 4 +- .../lib/{qtmaterialripple.h => ripple.h} | 6 +- ...ialrippleoverlay.cpp => rippleoverlay.cpp} | 4 +- ...aterialrippleoverlay.h => rippleoverlay.h} | 8 +- ...tatetransition.cpp => statetransition.cpp} | 2 +- ...ialstatetransition.h => statetransition.h} | 8 +- ...ansitionevent.h => statetransitionevent.h} | 6 +- .../lib/{qtmaterialstyle.cpp => style.cpp} | 4 +- components/lib/{qtmaterialstyle.h => style.h} | 8 +- .../lib/{qtmaterialstyle_p.h => style_p.h} | 6 +- .../lib/{qtmaterialtheme.cpp => theme.cpp} | 4 +- components/lib/{qtmaterialtheme.h => theme.h} | 6 +- .../lib/{qtmaterialtheme_p.h => theme_p.h} | 6 +- components/list.cpp | 2 + components/list.h | 4 + components/list_p.h | 4 + components/listitem.cpp | 2 + components/listitem.h | 4 + components/listitem_p.h | 4 + components/{qtmaterialmenu.cpp => menu.cpp} | 4 +- components/{qtmaterialmenu.h => menu.h} | 6 +- ...ialmenu_internal.cpp => menu_internal.cpp} | 0 components/menu_internal.h | 7 + components/menu_p.h | 7 + components/paper.cpp | 7 + components/paper.h | 7 + components/paper_p.h | 7 + .../{qtmaterialprogress.cpp => progress.cpp} | 8 +- .../{qtmaterialprogress.h => progress.h} | 8 +- ...ess_internal.cpp => progress_internal.cpp} | 2 +- ...rogress_internal.h => progress_internal.h} | 8 +- .../{qtmaterialprogress_p.h => progress_p.h} | 8 +- components/qtmateriallist.cpp | 2 - components/qtmateriallist.h | 4 - components/qtmateriallist_p.h | 4 - components/qtmateriallistitem.cpp | 2 - components/qtmateriallistitem.h | 4 - components/qtmateriallistitem_p.h | 4 - components/qtmaterialmenu_internal.h | 7 - components/qtmaterialmenu_p.h | 7 - components/qtmaterialpaper.cpp | 7 - components/qtmaterialpaper.h | 7 - components/qtmaterialpaper_p.h | 7 - components/qtmaterialtable.cpp | 6 - components/qtmaterialtable.h | 7 - components/qtmaterialtable_p.h | 7 - ...aterialradiobutton.cpp => radiobutton.cpp} | 6 +- ...{qtmaterialradiobutton.h => radiobutton.h} | 8 +- ...aterialradiobutton_p.h => radiobutton_p.h} | 10 +- ...erialraisedbutton.cpp => raisedbutton.cpp} | 2 +- ...tmaterialraisedbutton.h => raisedbutton.h} | 8 +- ...erialraisedbutton_p.h => raisedbutton_p.h} | 10 +- ...{qtmaterialscrollbar.cpp => scrollbar.cpp} | 2 +- .../{qtmaterialscrollbar.h => scrollbar.h} | 12 +- ...ar_internal.cpp => scrollbar_internal.cpp} | 2 +- ...ollbar_internal.h => scrollbar_internal.h} | 8 +- ...{qtmaterialscrollbar_p.h => scrollbar_p.h} | 6 +- .../{qtmaterialslider.cpp => slider.cpp} | 10 +- components/{qtmaterialslider.h => slider.h} | 6 +- ...lider_internal.cpp => slider_internal.cpp} | 8 +- ...ialslider_internal.h => slider_internal.h} | 8 +- .../{qtmaterialslider_p.h => slider_p.h} | 6 +- .../{qtmaterialsnackbar.cpp => snackbar.cpp} | 10 +- .../{qtmaterialsnackbar.h => snackbar.h} | 8 +- ...bar_internal.cpp => snackbar_internal.cpp} | 6 +- ...nackbar_internal.h => snackbar_internal.h} | 6 +- .../{qtmaterialsnackbar_p.h => snackbar_p.h} | 6 +- components/table.cpp | 6 + components/table.h | 7 + components/table_p.h | 7 + components/{qtmaterialtabs.cpp => tabs.cpp} | 2 +- components/{qtmaterialtabs.h => tabs.h} | 14 +- ...ialtabs_internal.cpp => tabs_internal.cpp} | 2 +- ...aterialtabs_internal.h => tabs_internal.h} | 12 +- components/{qtmaterialtabs_p.h => tabs_p.h} | 8 +- ...{qtmaterialtextfield.cpp => textfield.cpp} | 8 +- .../{qtmaterialtextfield.h => textfield.h} | 6 +- ...ld_internal.cpp => textfield_internal.cpp} | 2 +- ...tfield_internal.h => textfield_internal.h} | 8 +- ...{qtmaterialtextfield_p.h => textfield_p.h} | 6 +- .../{qtmaterialtoggle.cpp => toggle.cpp} | 8 +- components/{qtmaterialtoggle.h => toggle.h} | 6 +- ...oggle_internal.cpp => toggle_internal.cpp} | 6 +- ...ialtoggle_internal.h => toggle_internal.h} | 8 +- .../{qtmaterialtoggle_p.h => toggle_p.h} | 6 +- examples/appbarsettingseditor.h | 6 +- examples/autocompletesettingseditor.h | 4 +- examples/avatarsettingseditor.h | 4 +- examples/badgesettingseditor.cpp | 4 +- examples/badgesettingseditor.h | 4 +- examples/checkboxsettingseditor.h | 2 +- examples/circularprogresssettingseditor.h | 2 +- examples/dialogsettingseditor.h | 4 +- examples/drawersettingseditor.h | 2 +- examples/fabsettingseditor.h | 2 +- examples/flatbuttonsettingseditor.h | 2 +- examples/iconbuttonsettingseditor.h | 4 +- examples/menusettingseditor.h | 4 +- examples/progresssettingseditor.h | 4 +- examples/radiobuttonsettingseditor.h | 2 +- examples/raisedbuttonsettingseditor.h | 2 +- examples/scrollbarsettingseditor.h | 2 +- examples/slidersettingseditor.h | 2 +- examples/snackbarsettingseditor.h | 2 +- examples/tabssettingseditor.h | 2 +- examples/textfieldsettingseditor.h | 2 +- examples/togglesettingseditor.h | 2 +- 163 files changed, 592 insertions(+), 592 deletions(-) rename components/{qtmaterialappbar.cpp => appbar.cpp} (95%) rename components/{qtmaterialappbar.h => appbar.h} (92%) rename components/{qtmaterialappbar_p.h => appbar_p.h} (81%) rename components/{qtmaterialautocomplete.cpp => autocomplete.cpp} (99%) rename components/{qtmaterialautocomplete.h => autocomplete.h} (80%) rename components/{qtmaterialautocomplete_internal.cpp => autocomplete_internal.cpp} (97%) rename components/{qtmaterialautocomplete_internal.h => autocomplete_internal.h} (73%) rename components/{qtmaterialautocomplete_p.h => autocomplete_p.h} (74%) rename components/{qtmaterialavatar.cpp => avatar.cpp} (98%) rename components/{qtmaterialavatar.h => avatar.h} (90%) rename components/{qtmaterialavatar_p.h => avatar_p.h} (81%) rename components/{qtmaterialbadge.cpp => badge.cpp} (98%) rename components/{qtmaterialbadge.h => badge.h} (92%) rename components/{qtmaterialbadge_p.h => badge_p.h} (87%) rename components/{qtmaterialcheckbox.cpp => checkbox.cpp} (98%) rename components/{qtmaterialcheckbox.h => checkbox.h} (65%) rename components/{qtmaterialcheckbox_p.h => checkbox_p.h} (60%) rename components/{qtmaterialcircularprogress.cpp => circularprogress.cpp} (97%) rename components/{qtmaterialcircularprogress.h => circularprogress.h} (87%) rename components/{qtmaterialcircularprogress_internal.cpp => circularprogress_internal.cpp} (88%) rename components/{qtmaterialcircularprogress_internal.h => circularprogress_internal.h} (89%) rename components/{qtmaterialcircularprogress_p.h => circularprogress_p.h} (81%) rename components/{qtmaterialdialog.cpp => dialog.cpp} (99%) rename components/{qtmaterialdialog.h => dialog.h} (69%) rename components/{qtmaterialdialog_internal.cpp => dialog_internal.cpp} (98%) rename components/{qtmaterialdialog_internal.h => dialog_internal.h} (92%) rename components/{qtmaterialdialog_p.h => dialog_p.h} (87%) rename components/{qtmaterialdrawer.cpp => drawer.cpp} (99%) rename components/{qtmaterialdrawer.h => drawer.h} (85%) rename components/{qtmaterialdrawer_internal.cpp => drawer_internal.cpp} (98%) rename components/{qtmaterialdrawer_internal.h => drawer_internal.h} (97%) rename components/{qtmaterialdrawer_p.h => drawer_p.h} (100%) rename components/{qtmaterialfab.cpp => fab.cpp} (98%) rename components/{qtmaterialfab.h => fab.h} (89%) rename components/{qtmaterialfab_p.h => fab_p.h} (88%) rename components/{qtmaterialflatbutton.cpp => flatbutton.cpp} (98%) rename components/{qtmaterialflatbutton.h => flatbutton.h} (96%) rename components/{qtmaterialflatbutton_internal.cpp => flatbutton_internal.cpp} (99%) rename components/{qtmaterialflatbutton_internal.h => flatbutton_internal.h} (93%) rename components/{qtmaterialflatbutton_p.h => flatbutton_p.h} (91%) rename components/{qtmaterialiconbutton.cpp => iconbutton.cpp} (96%) rename components/{qtmaterialiconbutton.h => iconbutton.h} (90%) rename components/{qtmaterialiconbutton_p.h => iconbutton_p.h} (83%) delete mode 100644 components/layouts/qtmaterialsnackbarlayout.h delete mode 100644 components/layouts/qtmaterialsnackbarlayout_p.h rename components/layouts/{qtmaterialsnackbarlayout.cpp => snackbarlayout.cpp} (100%) create mode 100644 components/layouts/snackbarlayout.h create mode 100644 components/layouts/snackbarlayout_p.h rename components/lib/{qtmaterialcheckable.cpp => checkable.cpp} (97%) rename components/lib/{qtmaterialcheckable.h => checkable.h} (94%) rename components/lib/{qtmaterialcheckable_internal.cpp => checkable_internal.cpp} (94%) rename components/lib/{qtmaterialcheckable_internal.h => checkable_internal.h} (93%) rename components/lib/{qtmaterialcheckable_p.h => checkable_p.h} (90%) rename components/lib/{qtmaterialoverlaywidget.cpp => overlaywidget.cpp} (96%) rename components/lib/{qtmaterialoverlaywidget.h => overlaywidget.h} (79%) rename components/lib/{qtmaterialripple.cpp => ripple.cpp} (97%) rename components/lib/{qtmaterialripple.h => ripple.h} (97%) rename components/lib/{qtmaterialrippleoverlay.cpp => rippleoverlay.cpp} (95%) rename components/lib/{qtmaterialrippleoverlay.h => rippleoverlay.h} (88%) rename components/lib/{qtmaterialstatetransition.cpp => statetransition.cpp} (90%) rename components/lib/{qtmaterialstatetransition.h => statetransition.h} (66%) rename components/lib/{qtmaterialstatetransitionevent.h => statetransitionevent.h} (87%) rename components/lib/{qtmaterialstyle.cpp => style.cpp} (92%) rename components/lib/{qtmaterialstyle.h => style.h} (84%) rename components/lib/{qtmaterialstyle_p.h => style_p.h} (75%) rename components/lib/{qtmaterialtheme.cpp => theme.cpp} (99%) rename components/lib/{qtmaterialtheme.h => theme.h} (98%) rename components/lib/{qtmaterialtheme_p.h => theme_p.h} (79%) create mode 100644 components/list.cpp create mode 100644 components/list.h create mode 100644 components/list_p.h create mode 100644 components/listitem.cpp create mode 100644 components/listitem.h create mode 100644 components/listitem_p.h rename components/{qtmaterialmenu.cpp => menu.cpp} (61%) rename components/{qtmaterialmenu.h => menu.h} (67%) rename components/{qtmaterialmenu_internal.cpp => menu_internal.cpp} (100%) create mode 100644 components/menu_internal.h create mode 100644 components/menu_p.h create mode 100644 components/paper.cpp create mode 100644 components/paper.h create mode 100644 components/paper_p.h rename components/{qtmaterialprogress.cpp => progress.cpp} (96%) rename components/{qtmaterialprogress.h => progress.h} (88%) rename components/{qtmaterialprogress_internal.cpp => progress_internal.cpp} (87%) rename components/{qtmaterialprogress_internal.h => progress_internal.h} (80%) rename components/{qtmaterialprogress_p.h => progress_p.h} (81%) delete mode 100644 components/qtmateriallist.cpp delete mode 100644 components/qtmateriallist.h delete mode 100644 components/qtmateriallist_p.h delete mode 100644 components/qtmateriallistitem.cpp delete mode 100644 components/qtmateriallistitem.h delete mode 100644 components/qtmateriallistitem_p.h delete mode 100644 components/qtmaterialmenu_internal.h delete mode 100644 components/qtmaterialmenu_p.h delete mode 100644 components/qtmaterialpaper.cpp delete mode 100644 components/qtmaterialpaper.h delete mode 100644 components/qtmaterialpaper_p.h delete mode 100644 components/qtmaterialtable.cpp delete mode 100644 components/qtmaterialtable.h delete mode 100644 components/qtmaterialtable_p.h rename components/{qtmaterialradiobutton.cpp => radiobutton.cpp} (95%) rename components/{qtmaterialradiobutton.h => radiobutton.h} (68%) rename components/{qtmaterialradiobutton_p.h => radiobutton_p.h} (66%) rename components/{qtmaterialraisedbutton.cpp => raisedbutton.cpp} (98%) rename components/{qtmaterialraisedbutton.h => raisedbutton.h} (77%) rename components/{qtmaterialraisedbutton_p.h => raisedbutton_p.h} (76%) rename components/{qtmaterialscrollbar.cpp => scrollbar.cpp} (99%) rename components/{qtmaterialscrollbar.h => scrollbar.h} (84%) rename components/{qtmaterialscrollbar_internal.cpp => scrollbar_internal.cpp} (96%) rename components/{qtmaterialscrollbar_internal.h => scrollbar_internal.h} (84%) rename components/{qtmaterialscrollbar_p.h => scrollbar_p.h} (86%) rename components/{qtmaterialslider.cpp => slider.cpp} (97%) rename components/{qtmaterialslider.h => slider.h} (94%) rename components/{qtmaterialslider_internal.cpp => slider_internal.cpp} (98%) rename components/{qtmaterialslider_internal.h => slider_internal.h} (97%) rename components/{qtmaterialslider_p.h => slider_p.h} (92%) rename components/{qtmaterialsnackbar.cpp => snackbar.cpp} (96%) rename components/{qtmaterialsnackbar.h => snackbar.h} (89%) rename components/{qtmaterialsnackbar_internal.cpp => snackbar_internal.cpp} (96%) rename components/{qtmaterialsnackbar_internal.h => snackbar_internal.h} (86%) rename components/{qtmaterialsnackbar_p.h => snackbar_p.h} (88%) create mode 100644 components/table.cpp create mode 100644 components/table.h create mode 100644 components/table_p.h rename components/{qtmaterialtabs.cpp => tabs.cpp} (99%) rename components/{qtmaterialtabs.h => tabs.h} (84%) rename components/{qtmaterialtabs_internal.cpp => tabs_internal.cpp} (99%) rename components/{qtmaterialtabs_internal.h => tabs_internal.h} (88%) rename components/{qtmaterialtabs_p.h => tabs_p.h} (84%) rename components/{qtmaterialtextfield.cpp => textfield.cpp} (97%) rename components/{qtmaterialtextfield.h => textfield.h} (93%) rename components/{qtmaterialtextfield_internal.cpp => textfield_internal.cpp} (99%) rename components/{qtmaterialtextfield_internal.h => textfield_internal.h} (94%) rename components/{qtmaterialtextfield_p.h => textfield_p.h} (90%) rename components/{qtmaterialtoggle.cpp => toggle.cpp} (97%) rename components/{qtmaterialtoggle.h => toggle.h} (93%) rename components/{qtmaterialtoggle_internal.cpp => toggle_internal.cpp} (98%) rename components/{qtmaterialtoggle_internal.h => toggle_internal.h} (94%) rename components/{qtmaterialtoggle_p.h => toggle_p.h} (91%) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 29e16fbe6..f745584be 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -21,130 +21,130 @@ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS StateMachine REQUIRED) # Create a library called "components" which includes the source file "*.cpp". # The extension is already found. Any number of sources could be listed here. set(PROJECT_SOURCES - qtmaterialavatar.cpp - lib/qtmaterialstyle.cpp - lib/qtmaterialtheme.cpp - qtmaterialbadge.cpp - lib/qtmaterialoverlaywidget.cpp - qtmaterialcheckbox.cpp - lib/qtmaterialcheckable_internal.cpp - lib/qtmaterialcheckable.cpp - lib/qtmaterialripple.cpp - lib/qtmaterialrippleoverlay.cpp - qtmaterialfab.cpp - qtmaterialraisedbutton.cpp - qtmaterialflatbutton_internal.cpp - qtmaterialflatbutton.cpp - lib/qtmaterialstatetransition.cpp - qtmaterialiconbutton.cpp - qtmaterialprogress_internal.cpp - qtmaterialprogress.cpp - qtmaterialcircularprogress_internal.cpp - qtmaterialcircularprogress.cpp - qtmaterialslider_internal.cpp - qtmaterialslider.cpp - qtmaterialsnackbar_internal.cpp - qtmaterialsnackbar.cpp - qtmaterialradiobutton.cpp - qtmaterialtoggle_internal.cpp - qtmaterialtoggle.cpp - qtmaterialtextfield_internal.cpp - qtmaterialtextfield.cpp - qtmaterialtabs_internal.cpp - qtmaterialtabs.cpp - qtmaterialscrollbar_internal.cpp - qtmaterialscrollbar.cpp - qtmaterialdialog_internal.cpp - qtmaterialdialog.cpp - qtmaterialdrawer_internal.cpp - qtmaterialdrawer.cpp - qtmaterialappbar.cpp - qtmaterialautocomplete.cpp - qtmaterialpaper.cpp - qtmaterialtable.cpp - layouts/qtmaterialsnackbarlayout.cpp - qtmaterialautocomplete_internal.cpp - qtmaterialmenu.cpp - qtmaterialmenu_internal.cpp - qtmateriallist.cpp - qtmateriallistitem.cpp - qtmaterialavatar_p.h - qtmaterialavatar.h - lib/qtmaterialstyle_p.h - lib/qtmaterialstyle.h - lib/qtmaterialtheme_p.h - lib/qtmaterialtheme.h - qtmaterialbadge_p.h - qtmaterialbadge.h - lib/qtmaterialoverlaywidget.h - qtmaterialcheckbox_p.h - qtmaterialcheckbox.h - lib/qtmaterialcheckable_internal.h - lib/qtmaterialcheckable_p.h - lib/qtmaterialripple.h - lib/qtmaterialrippleoverlay.h - lib/qtmaterialcheckable.h - qtmaterialfab_p.h - qtmaterialfab.h - qtmaterialraisedbutton_p.h - qtmaterialraisedbutton.h - qtmaterialflatbutton_internal.h - qtmaterialflatbutton_p.h - qtmaterialflatbutton.h - lib/qtmaterialstatetransition.h - lib/qtmaterialstatetransitionevent.h - qtmaterialiconbutton_p.h - qtmaterialiconbutton.h - qtmaterialprogress_internal.h - qtmaterialprogress_p.h - qtmaterialprogress.h - qtmaterialcircularprogress_internal.h - qtmaterialcircularprogress_p.h - qtmaterialcircularprogress.h - qtmaterialslider_internal.h - qtmaterialslider_p.h - qtmaterialslider.h - qtmaterialsnackbar_internal.h - qtmaterialsnackbar_p.h - qtmaterialsnackbar.h - qtmaterialradiobutton_p.h - qtmaterialradiobutton.h - qtmaterialtoggle_internal.h - qtmaterialtoggle_p.h - qtmaterialtoggle.h - qtmaterialtextfield_internal.h - qtmaterialtextfield_p.h - qtmaterialtextfield.h - qtmaterialtabs_internal.h - qtmaterialtabs_p.h - qtmaterialtabs.h - qtmaterialscrollbar_internal.h - qtmaterialscrollbar_p.h - qtmaterialscrollbar.h - qtmaterialdialog_internal.h - qtmaterialdialog_p.h - qtmaterialdialog.h - qtmaterialdrawer_internal.h - qtmaterialdrawer_p.h - qtmaterialdrawer.h - qtmaterialappbar.h - qtmaterialappbar_p.h - qtmaterialautocomplete.h - qtmaterialautocomplete_p.h - qtmaterialpaper.h - qtmaterialpaper_p.h - qtmaterialtable.h - qtmaterialtable_p.h - layouts/qtmaterialsnackbarlayout.h - layouts/qtmaterialsnackbarlayout_p.h - qtmaterialautocomplete_internal.h - qtmaterialmenu.h - qtmaterialmenu_p.h - qtmaterialmenu_internal.h - qtmateriallist.h - qtmateriallist_p.h - qtmateriallistitem.h - qtmateriallistitem_p.h + avatar.cpp + lib/style.cpp + lib/theme.cpp + badge.cpp + lib/overlaywidget.cpp + checkbox.cpp + lib/checkable_internal.cpp + lib/checkable.cpp + lib/ripple.cpp + lib/rippleoverlay.cpp + fab.cpp + raisedbutton.cpp + flatbutton_internal.cpp + flatbutton.cpp + lib/statetransition.cpp + iconbutton.cpp + progress_internal.cpp + progress.cpp + circularprogress_internal.cpp + circularprogress.cpp + slider_internal.cpp + slider.cpp + snackbar_internal.cpp + snackbar.cpp + radiobutton.cpp + toggle_internal.cpp + toggle.cpp + textfield_internal.cpp + textfield.cpp + tabs_internal.cpp + tabs.cpp + scrollbar_internal.cpp + scrollbar.cpp + dialog_internal.cpp + dialog.cpp + drawer_internal.cpp + drawer.cpp + appbar.cpp + autocomplete.cpp + paper.cpp + table.cpp + layouts/snackbarlayout.cpp + autocomplete_internal.cpp + menu.cpp + menu_internal.cpp + list.cpp + listitem.cpp + avatar_p.h + avatar.h + lib/style_p.h + lib/style.h + lib/theme_p.h + lib/theme.h + badge_p.h + badge.h + lib/overlaywidget.h + checkbox_p.h + checkbox.h + lib/checkable_internal.h + lib/checkable_p.h + lib/ripple.h + lib/rippleoverlay.h + lib/checkable.h + fab_p.h + fab.h + raisedbutton_p.h + raisedbutton.h + flatbutton_internal.h + flatbutton_p.h + flatbutton.h + lib/statetransition.h + lib/statetransitionevent.h + iconbutton_p.h + iconbutton.h + progress_internal.h + progress_p.h + progress.h + circularprogress_internal.h + circularprogress_p.h + circularprogress.h + slider_internal.h + slider_p.h + slider.h + snackbar_internal.h + snackbar_p.h + snackbar.h + radiobutton_p.h + radiobutton.h + toggle_internal.h + toggle_p.h + toggle.h + textfield_internal.h + textfield_p.h + textfield.h + tabs_internal.h + tabs_p.h + tabs.h + scrollbar_internal.h + scrollbar_p.h + scrollbar.h + dialog_internal.h + dialog_p.h + dialog.h + drawer_internal.h + drawer_p.h + drawer.h + appbar.h + appbar_p.h + autocomplete.h + autocomplete_p.h + paper.h + paper_p.h + table.h + table_p.h + layouts/snackbarlayout.h + layouts/snackbarlayout_p.h + autocomplete_internal.h + menu.h + menu_p.h + menu_internal.h + list.h + list_p.h + listitem.h + listitem_p.h ) if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) diff --git a/components/qtmaterialappbar.cpp b/components/appbar.cpp similarity index 95% rename from components/qtmaterialappbar.cpp rename to components/appbar.cpp index a93a6f35a..557765b34 100644 --- a/components/qtmaterialappbar.cpp +++ b/components/appbar.cpp @@ -1,8 +1,8 @@ -#include "qtmaterialappbar.h" -#include "qtmaterialappbar_p.h" +#include "appbar.h" +#include "appbar_p.h" #include #include -#include "lib/qtmaterialstyle.h" +#include "lib/style.h" namespace md { /*! diff --git a/components/qtmaterialappbar.h b/components/appbar.h similarity index 92% rename from components/qtmaterialappbar.h rename to components/appbar.h index 8e7fb14b9..e0168a410 100644 --- a/components/qtmaterialappbar.h +++ b/components/appbar.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALAPPBAR_H -#define QTMATERIALAPPBAR_H +#ifndef APPBAR_H +#define APPBAR_H #include #include @@ -50,4 +50,4 @@ inline QHBoxLayout *AppBar::appBarLayout() const } -#endif // QTMATERIALAPPBAR_H +#endif // APPBAR_H diff --git a/components/qtmaterialappbar_p.h b/components/appbar_p.h similarity index 81% rename from components/qtmaterialappbar_p.h rename to components/appbar_p.h index cd344cd7b..85e2c55af 100644 --- a/components/qtmaterialappbar_p.h +++ b/components/appbar_p.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALAPPBAR_P_H -#define QTMATERIALAPPBAR_P_H +#ifndef APPBAR_P_H +#define APPBAR_P_H #include #include @@ -28,4 +28,4 @@ class AppBarPrivate } -#endif // QTMATERIALAPPBAR_P_H +#endif // APPBAR_P_H diff --git a/components/qtmaterialautocomplete.cpp b/components/autocomplete.cpp similarity index 99% rename from components/qtmaterialautocomplete.cpp rename to components/autocomplete.cpp index ecaf1fe61..463595fff 100644 --- a/components/qtmaterialautocomplete.cpp +++ b/components/autocomplete.cpp @@ -1,4 +1,4 @@ -#include "qtmaterialautocomplete_p.h" +#include "autocomplete_p.h" namespace md diff --git a/components/qtmaterialautocomplete.h b/components/autocomplete.h similarity index 80% rename from components/qtmaterialautocomplete.h rename to components/autocomplete.h index 0e6a2347d..cf126c131 100644 --- a/components/qtmaterialautocomplete.h +++ b/components/autocomplete.h @@ -1,7 +1,7 @@ -#ifndef QTMATERIALAUTOCOMPLETE_H -#define QTMATERIALAUTOCOMPLETE_H +#ifndef AUTOCOMPLETE_H +#define AUTOCOMPLETE_H -#include "qtmaterialtextfield.h" +#include "textfield.h" namespace md { @@ -35,4 +35,4 @@ protected slots: } -#endif // QTMATERIALAUTOCOMPLETE_H +#endif // AUTOCOMPLETE_H diff --git a/components/qtmaterialautocomplete_internal.cpp b/components/autocomplete_internal.cpp similarity index 97% rename from components/qtmaterialautocomplete_internal.cpp rename to components/autocomplete_internal.cpp index 75c548ccd..7fff61bd9 100644 --- a/components/qtmaterialautocomplete_internal.cpp +++ b/components/autocomplete_internal.cpp @@ -1,4 +1,4 @@ -#include "qtmaterialautocomplete_internal.h" +#include "autocomplete_internal.h" #include #include #include diff --git a/components/qtmaterialautocomplete_internal.h b/components/autocomplete_internal.h similarity index 73% rename from components/qtmaterialautocomplete_internal.h rename to components/autocomplete_internal.h index 0621eab5d..d628b553c 100644 --- a/components/qtmaterialautocomplete_internal.h +++ b/components/autocomplete_internal.h @@ -1,8 +1,8 @@ -#ifndef QTMATERIALAUTOCOMPLETESTATEMACHINE_H -#define QTMATERIALAUTOCOMPLETESTATEMACHINE_H +#ifndef AUTOCOMPLETESTATEMACHINE_H +#define AUTOCOMPLETESTATEMACHINE_H #include -#include "qtmaterialautocomplete.h" +#include "autocomplete.h" namespace md { @@ -31,4 +31,4 @@ class AutoCompleteStateMachine : public QStateMachine } -#endif // QTMATERIALAUTOCOMPLETESTATEMACHINE_H +#endif // AUTOCOMPLETESTATEMACHINE_H diff --git a/components/qtmaterialautocomplete_p.h b/components/autocomplete_p.h similarity index 74% rename from components/qtmaterialautocomplete_p.h rename to components/autocomplete_p.h index fd5004cb6..a0baae9e9 100644 --- a/components/qtmaterialautocomplete_p.h +++ b/components/autocomplete_p.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALAUTOCOMPLETE_P_H -#define QTMATERIALAUTOCOMPLETE_P_H +#ifndef AUTOCOMPLETE_P_H +#define AUTOCOMPLETE_P_H #include #include @@ -8,10 +8,10 @@ #include #include -#include "qtmaterialautocomplete.h" -#include "qtmaterialautocomplete_internal.h" -#include "qtmaterialflatbutton.h" -#include "qtmaterialtextfield_p.h" +#include "autocomplete.h" +#include "autocomplete_internal.h" +#include "flatbutton.h" +#include "textfield_p.h" namespace md { @@ -40,4 +40,4 @@ class AutoCompletePrivate : public TextFieldPrivate } -#endif // QTMATERIALAUTOCOMPLETE_P_H +#endif // AUTOCOMPLETE_P_H diff --git a/components/qtmaterialavatar.cpp b/components/avatar.cpp similarity index 98% rename from components/qtmaterialavatar.cpp rename to components/avatar.cpp index 56578dc19..c1d0ea20f 100644 --- a/components/qtmaterialavatar.cpp +++ b/components/avatar.cpp @@ -1,8 +1,8 @@ -#include "qtmaterialavatar.h" -#include "qtmaterialavatar_p.h" +#include "avatar.h" +#include "avatar_p.h" #include #include -#include "lib/qtmaterialstyle.h" +#include "lib/style.h" namespace md { diff --git a/components/qtmaterialavatar.h b/components/avatar.h similarity index 90% rename from components/qtmaterialavatar.h rename to components/avatar.h index a118421df..3fefc28e8 100644 --- a/components/qtmaterialavatar.h +++ b/components/avatar.h @@ -1,8 +1,8 @@ -#ifndef QTMATERIALAVATAR_H -#define QTMATERIALAVATAR_H +#ifndef AVATAR_H +#define AVATAR_H #include -#include "lib/qtmaterialtheme.h" +#include "lib/theme.h" namespace md { class AvatarPrivate; @@ -49,4 +49,4 @@ class Avatar : public QWidget }; } -#endif // QTMATERIALAVATAR_H +#endif // AVATAR_H diff --git a/components/qtmaterialavatar_p.h b/components/avatar_p.h similarity index 81% rename from components/qtmaterialavatar_p.h rename to components/avatar_p.h index 4870d7700..5901b24f5 100644 --- a/components/qtmaterialavatar_p.h +++ b/components/avatar_p.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALAVATAR_P_H -#define QTMATERIALAVATAR_P_H +#ifndef AVATAR_P_H +#define AVATAR_P_H #include #include @@ -7,7 +7,7 @@ #include #include #include -#include "lib/qtmaterialtheme.h" +#include "lib/theme.h" namespace md { @@ -39,4 +39,4 @@ class AvatarPrivate } -#endif // QTMATERIALAVATAR_P_H +#endif // AVATAR_P_H diff --git a/components/qtmaterialbadge.cpp b/components/badge.cpp similarity index 98% rename from components/qtmaterialbadge.cpp rename to components/badge.cpp index 71046feba..f6dff5ab4 100644 --- a/components/qtmaterialbadge.cpp +++ b/components/badge.cpp @@ -1,7 +1,7 @@ -#include "qtmaterialbadge.h" -#include "qtmaterialbadge_p.h" +#include "badge.h" +#include "badge_p.h" #include -#include "lib/qtmaterialstyle.h" +#include "lib/style.h" namespace md { diff --git a/components/qtmaterialbadge.h b/components/badge.h similarity index 92% rename from components/qtmaterialbadge.h rename to components/badge.h index 8df8dffa1..80f504f45 100644 --- a/components/qtmaterialbadge.h +++ b/components/badge.h @@ -1,7 +1,7 @@ -#ifndef QTMATERIALBADGE_H -#define QTMATERIALBADGE_H +#ifndef BADGE_H +#define BADGE_H -#include "lib/qtmaterialoverlaywidget.h" +#include "lib/overlaywidget.h" namespace md { @@ -62,4 +62,4 @@ class Badge : public OverlayWidget } -#endif // QTMATERIALBADGE_H +#endif // BADGE_H diff --git a/components/qtmaterialbadge_p.h b/components/badge_p.h similarity index 87% rename from components/qtmaterialbadge_p.h rename to components/badge_p.h index c72d5a492..89a110fcb 100644 --- a/components/qtmaterialbadge_p.h +++ b/components/badge_p.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALBADGE_P_H -#define QTMATERIALBADGE_P_H +#ifndef BADGE_P_H +#define BADGE_P_H #include #include @@ -34,4 +34,4 @@ class BadgePrivate }; } -#endif // QTMATERIALBADGE_P_H +#endif // BADGE_P_H diff --git a/components/qtmaterialcheckbox.cpp b/components/checkbox.cpp similarity index 98% rename from components/qtmaterialcheckbox.cpp rename to components/checkbox.cpp index 9ef8e5157..4e491b444 100644 --- a/components/qtmaterialcheckbox.cpp +++ b/components/checkbox.cpp @@ -1,4 +1,4 @@ -#include "qtmaterialcheckbox_p.h" +#include "checkbox_p.h" namespace md { diff --git a/components/qtmaterialcheckbox.h b/components/checkbox.h similarity index 65% rename from components/qtmaterialcheckbox.h rename to components/checkbox.h index b09de4f03..743cb4050 100644 --- a/components/qtmaterialcheckbox.h +++ b/components/checkbox.h @@ -1,7 +1,7 @@ -#ifndef QTMATERIALCHECKBOX_H -#define QTMATERIALCHECKBOX_H +#ifndef CHECKBOX_H +#define CHECKBOX_H -#include "lib/qtmaterialcheckable.h" +#include "lib/checkable.h" namespace md { @@ -22,4 +22,4 @@ class CheckBox : public Checkable }; } -#endif // QTMATERIALCHECKBOX_H +#endif // CHECKBOX_H diff --git a/components/qtmaterialcheckbox_p.h b/components/checkbox_p.h similarity index 60% rename from components/qtmaterialcheckbox_p.h rename to components/checkbox_p.h index 565e6c144..da3471ca7 100644 --- a/components/qtmaterialcheckbox_p.h +++ b/components/checkbox_p.h @@ -1,13 +1,13 @@ -#ifndef QTMATERIALCHECKBOX_P_H -#define QTMATERIALCHECKBOX_P_H +#ifndef CHECKBOX_P_H +#define CHECKBOX_P_H #include #include #include -#include "qtmaterialcheckbox.h" -#include "lib/qtmaterialcheckable_internal.h" -#include "lib/qtmaterialcheckable_p.h" +#include "checkbox.h" +#include "lib/checkable_internal.h" +#include "lib/checkable_p.h" namespace md { @@ -26,4 +26,4 @@ class CheckBoxPrivate : public CheckablePrivate void init(); }; } -#endif // QTMATERIALCHECKBOX_P_H +#endif // CHECKBOX_P_H diff --git a/components/qtmaterialcircularprogress.cpp b/components/circularprogress.cpp similarity index 97% rename from components/qtmaterialcircularprogress.cpp rename to components/circularprogress.cpp index 6718756c1..2203a2eb3 100644 --- a/components/qtmaterialcircularprogress.cpp +++ b/components/circularprogress.cpp @@ -1,11 +1,11 @@ -#include "qtmaterialcircularprogress.h" -#include "qtmaterialcircularprogress_p.h" +#include "circularprogress.h" +#include "circularprogress_p.h" #include #include #include #include -#include "qtmaterialcircularprogress_internal.h" -#include "lib/qtmaterialstyle.h" +#include "circularprogress_internal.h" +#include "lib/style.h" namespace md { diff --git a/components/qtmaterialcircularprogress.h b/components/circularprogress.h similarity index 87% rename from components/qtmaterialcircularprogress.h rename to components/circularprogress.h index 3273f4a04..365e7d313 100644 --- a/components/qtmaterialcircularprogress.h +++ b/components/circularprogress.h @@ -1,8 +1,8 @@ -#ifndef QTMATERIALCIRCULARPROGRESS_H -#define QTMATERIALCIRCULARPROGRESS_H +#ifndef CIRCULARPROGRESS_H +#define CIRCULARPROGRESS_H #include -#include "lib/qtmaterialtheme.h" +#include "lib/theme.h" namespace md { @@ -50,4 +50,4 @@ class CircularProgress : public QProgressBar } -#endif // QTMATERIALCIRCULARPROGRESS_H +#endif // CIRCULARPROGRESS_H diff --git a/components/qtmaterialcircularprogress_internal.cpp b/components/circularprogress_internal.cpp similarity index 88% rename from components/qtmaterialcircularprogress_internal.cpp rename to components/circularprogress_internal.cpp index 79a55b213..5480a1ff7 100644 --- a/components/qtmaterialcircularprogress_internal.cpp +++ b/components/circularprogress_internal.cpp @@ -1,4 +1,4 @@ -#include "qtmaterialcircularprogress_internal.h" +#include "circularprogress_internal.h" namespace md { diff --git a/components/qtmaterialcircularprogress_internal.h b/components/circularprogress_internal.h similarity index 89% rename from components/qtmaterialcircularprogress_internal.h rename to components/circularprogress_internal.h index 41a5f6b24..5273a8e37 100644 --- a/components/qtmaterialcircularprogress_internal.h +++ b/components/circularprogress_internal.h @@ -1,8 +1,8 @@ -#ifndef QTMATERIALCIRCULARPROGRESS_INTERNAL_H -#define QTMATERIALCIRCULARPROGRESS_INTERNAL_H +#ifndef CIRCULARPROGRESS_INTERNAL_H +#define CIRCULARPROGRESS_INTERNAL_H #include -#include "qtmaterialcircularprogress.h" +#include "circularprogress.h" namespace md { @@ -71,4 +71,4 @@ inline int CircularProgressDelegate::angle() const } -#endif // QTMATERIALCIRCULARPROGRESS_INTERNAL_H +#endif // CIRCULARPROGRESS_INTERNAL_H diff --git a/components/qtmaterialcircularprogress_p.h b/components/circularprogress_p.h similarity index 81% rename from components/qtmaterialcircularprogress_p.h rename to components/circularprogress_p.h index 66a4592a5..ad229305b 100644 --- a/components/qtmaterialcircularprogress_p.h +++ b/components/circularprogress_p.h @@ -1,8 +1,8 @@ -#ifndef QTMATERIALCIRCULARPROGRESS_P_H -#define QTMATERIALCIRCULARPROGRESS_P_H +#ifndef CIRCULARPROGRESS_P_H +#define CIRCULARPROGRESS_P_H #include -#include "lib/qtmaterialtheme.h" +#include "lib/theme.h" namespace md { @@ -31,4 +31,4 @@ class CircularProgressPrivate } -#endif // QTMATERIALCIRCULARPROGRESS_P_H +#endif // CIRCULARPROGRESS_P_H diff --git a/components/qtmaterialdialog.cpp b/components/dialog.cpp similarity index 99% rename from components/qtmaterialdialog.cpp rename to components/dialog.cpp index 7a5a6d860..78e7f6176 100644 --- a/components/qtmaterialdialog.cpp +++ b/components/dialog.cpp @@ -1,4 +1,4 @@ -#include "qtmaterialdialog.h" +#include "dialog.h" namespace md { diff --git a/components/qtmaterialdialog.h b/components/dialog.h similarity index 69% rename from components/qtmaterialdialog.h rename to components/dialog.h index fc3c668ac..5429c85f3 100644 --- a/components/qtmaterialdialog.h +++ b/components/dialog.h @@ -1,13 +1,13 @@ -#ifndef QTMATERIALDIALOG_H -#define QTMATERIALDIALOG_H +#ifndef DIALOG_H +#define DIALOG_H #include #include -#include "qtmaterialdialog_p.h" -#include "qtmaterialdialog_internal.h" -#include "lib/qtmaterialstatetransition.h" -#include "lib/qtmaterialoverlaywidget.h" +#include "dialog_p.h" +#include "dialog_internal.h" +#include "lib/statetransition.h" +#include "lib/overlaywidget.h" namespace md { @@ -39,4 +39,4 @@ public slots: Q_DECLARE_PRIVATE(Dialog) }; } -#endif // QTMATERIALDIALOG_H +#endif // DIALOG_H diff --git a/components/qtmaterialdialog_internal.cpp b/components/dialog_internal.cpp similarity index 98% rename from components/qtmaterialdialog_internal.cpp rename to components/dialog_internal.cpp index c93ffbb3d..1e58c7e0e 100644 --- a/components/qtmaterialdialog_internal.cpp +++ b/components/dialog_internal.cpp @@ -1,4 +1,4 @@ -#include "qtmaterialdialog_internal.h" +#include "dialog_internal.h" namespace md { diff --git a/components/qtmaterialdialog_internal.h b/components/dialog_internal.h similarity index 92% rename from components/qtmaterialdialog_internal.h rename to components/dialog_internal.h index b1f49de8d..11468882a 100644 --- a/components/qtmaterialdialog_internal.h +++ b/components/dialog_internal.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALDIALOG_INTERNAL_H -#define QTMATERIALDIALOG_INTERNAL_H +#ifndef DIALOG_INTERNAL_H +#define DIALOG_INTERNAL_H #include #include @@ -7,7 +7,7 @@ #include #include -#include "qtmaterialdialog.h" +#include "dialog.h" namespace md { @@ -85,5 +85,5 @@ class DialogWindow : public QWidget }; } -#endif // QTMATERIALDIALOG_INTERNAL_H +#endif // DIALOG_INTERNAL_H diff --git a/components/qtmaterialdialog_p.h b/components/dialog_p.h similarity index 87% rename from components/qtmaterialdialog_p.h rename to components/dialog_p.h index d1b7cbf5f..11db165d0 100644 --- a/components/qtmaterialdialog_p.h +++ b/components/dialog_p.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALDIALOG_P_H -#define QTMATERIALDIALOG_P_H +#ifndef DIALOG_P_H +#define DIALOG_P_H #include #include @@ -36,4 +36,4 @@ class DialogPrivate DialogProxy *proxy; }; } -#endif // QTMATERIALDIALOG_P_H +#endif // DIALOG_P_H diff --git a/components/qtmaterialdrawer.cpp b/components/drawer.cpp similarity index 99% rename from components/qtmaterialdrawer.cpp rename to components/drawer.cpp index c6dc1747b..49e2261d7 100644 --- a/components/qtmaterialdrawer.cpp +++ b/components/drawer.cpp @@ -1,4 +1,4 @@ -#include "qtmaterialdrawer.h" +#include "drawer.h" namespace md { diff --git a/components/qtmaterialdrawer.h b/components/drawer.h similarity index 85% rename from components/qtmaterialdrawer.h rename to components/drawer.h index b0e7f0a83..a88147682 100644 --- a/components/qtmaterialdrawer.h +++ b/components/drawer.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALDRAWER_H -#define QTMATERIALDRAWER_H +#ifndef DRAWER_H +#define DRAWER_H #include #include @@ -10,9 +10,9 @@ #include #include -#include "qtmaterialdrawer_p.h" -#include "qtmaterialdrawer_internal.h" -#include "lib/qtmaterialoverlaywidget.h" +#include "drawer_p.h" +#include "drawer_internal.h" +#include "lib/overlaywidget.h" namespace md { @@ -59,4 +59,4 @@ public slots: Q_DECLARE_PRIVATE(Drawer) }; } -#endif // QTMATERIALDRAWER_H +#endif // DRAWER_H diff --git a/components/qtmaterialdrawer_internal.cpp b/components/drawer_internal.cpp similarity index 98% rename from components/qtmaterialdrawer_internal.cpp rename to components/drawer_internal.cpp index 3d354cb90..3e2f1e777 100644 --- a/components/qtmaterialdrawer_internal.cpp +++ b/components/drawer_internal.cpp @@ -1,10 +1,10 @@ -#include "qtmaterialdrawer_internal.h" +#include "drawer_internal.h" #include #include #include #include #include -#include "qtmaterialdrawer.h" +#include "drawer.h" namespace md { /*! diff --git a/components/qtmaterialdrawer_internal.h b/components/drawer_internal.h similarity index 97% rename from components/qtmaterialdrawer_internal.h rename to components/drawer_internal.h index ca2d9ca01..537017947 100644 --- a/components/qtmaterialdrawer_internal.h +++ b/components/drawer_internal.h @@ -2,7 +2,7 @@ #define DRAWER_INTERNAL_H #include -#include "lib/qtmaterialoverlaywidget.h" +#include "lib/overlaywidget.h" namespace md { diff --git a/components/qtmaterialdrawer_p.h b/components/drawer_p.h similarity index 100% rename from components/qtmaterialdrawer_p.h rename to components/drawer_p.h diff --git a/components/qtmaterialfab.cpp b/components/fab.cpp similarity index 98% rename from components/qtmaterialfab.cpp rename to components/fab.cpp index c7e0479c8..0e57f68f3 100644 --- a/components/qtmaterialfab.cpp +++ b/components/fab.cpp @@ -1,10 +1,10 @@ -#include "qtmaterialfab.h" -#include "qtmaterialfab_p.h" +#include "fab.h" +#include "fab_p.h" #include #include #include #include -#include "lib/qtmaterialrippleoverlay.h" +#include "lib/rippleoverlay.h" namespace md { diff --git a/components/qtmaterialfab.h b/components/fab.h similarity index 89% rename from components/qtmaterialfab.h rename to components/fab.h index 9e23cc00a..5a979430a 100644 --- a/components/qtmaterialfab.h +++ b/components/fab.h @@ -1,7 +1,7 @@ -#ifndef QTMATERIALFAB_H -#define QTMATERIALFAB_H +#ifndef FAB_H +#define FAB_H -#include "qtmaterialraisedbutton.h" +#include "raisedbutton.h" namespace md { @@ -45,4 +45,4 @@ class FloatingActionButton : public RaisedButton }; } -#endif // QTMATERIALFAB_H +#endif // FAB_H diff --git a/components/qtmaterialfab_p.h b/components/fab_p.h similarity index 88% rename from components/qtmaterialfab_p.h rename to components/fab_p.h index 6cd73552d..9055fd1a6 100644 --- a/components/qtmaterialfab_p.h +++ b/components/fab_p.h @@ -1,7 +1,7 @@ -#ifndef QTMATERIALFAB_P_H -#define QTMATERIALFAB_P_H +#ifndef FAB_P_H +#define FAB_P_H -#include "qtmaterialraisedbutton_p.h" +#include "raisedbutton_p.h" namespace md { @@ -49,4 +49,4 @@ inline int FloatingActionButtonPrivate::iconSize() const return mini ? MiniIconSize : DefaultIconSize; } } -#endif // QTMATERIALFAB_P_H +#endif // FAB_P_H diff --git a/components/qtmaterialflatbutton.cpp b/components/flatbutton.cpp similarity index 98% rename from components/qtmaterialflatbutton.cpp rename to components/flatbutton.cpp index 0c1b1c691..5b1c0fb9c 100644 --- a/components/qtmaterialflatbutton.cpp +++ b/components/flatbutton.cpp @@ -1,15 +1,15 @@ -#include "qtmaterialflatbutton.h" -#include "qtmaterialflatbutton_p.h" +#include "flatbutton.h" +#include "flatbutton_p.h" #include #include #include #include #include #include -#include "lib/qtmaterialrippleoverlay.h" -#include "lib/qtmaterialripple.h" -#include "lib/qtmaterialstyle.h" -#include "qtmaterialflatbutton_internal.h" +#include "lib/rippleoverlay.h" +#include "lib/ripple.h" +#include "lib/style.h" +#include "flatbutton_internal.h" namespace md { diff --git a/components/qtmaterialflatbutton.h b/components/flatbutton.h similarity index 96% rename from components/qtmaterialflatbutton.h rename to components/flatbutton.h index 48c945480..554ac3908 100644 --- a/components/qtmaterialflatbutton.h +++ b/components/flatbutton.h @@ -1,9 +1,9 @@ -#ifndef QTMATERIALFLATBUTTON_H -#define QTMATERIALFLATBUTTON_H +#ifndef FLATBUTTON_H +#define FLATBUTTON_H #include #include -#include "lib/qtmaterialtheme.h" +#include "lib/theme.h" namespace md { @@ -113,4 +113,4 @@ class FlatButton : public QPushButton } -#endif // QTMATERIALFLATBUTTON_H +#endif // FLATBUTTON_H diff --git a/components/qtmaterialflatbutton_internal.cpp b/components/flatbutton_internal.cpp similarity index 99% rename from components/qtmaterialflatbutton_internal.cpp rename to components/flatbutton_internal.cpp index 53142c558..de0991c25 100644 --- a/components/qtmaterialflatbutton_internal.cpp +++ b/components/flatbutton_internal.cpp @@ -1,4 +1,4 @@ -#include "qtmaterialflatbutton_internal.h" +#include "flatbutton_internal.h" namespace md { diff --git a/components/qtmaterialflatbutton_internal.h b/components/flatbutton_internal.h similarity index 93% rename from components/qtmaterialflatbutton_internal.h rename to components/flatbutton_internal.h index 8eef9ff46..4e31a4b89 100644 --- a/components/qtmaterialflatbutton_internal.h +++ b/components/flatbutton_internal.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALFLATBUTTON_INTERNAL_H -#define QTMATERIALFLATBUTTON_INTERNAL_H +#ifndef FLATBUTTON_INTERNAL_H +#define FLATBUTTON_INTERNAL_H #include #include @@ -8,8 +8,8 @@ #include #include -#include "qtmaterialflatbutton.h" -#include "lib/qtmaterialstatetransition.h" +#include "flatbutton.h" +#include "lib/statetransition.h" namespace md { @@ -109,4 +109,4 @@ inline qreal FlatButtonStateMachine::haloScaleFactor() const } } -#endif // QTMATERIALFLATBUTTON_INTERNAL_H +#endif // FLATBUTTON_INTERNAL_H diff --git a/components/qtmaterialflatbutton_p.h b/components/flatbutton_p.h similarity index 91% rename from components/qtmaterialflatbutton_p.h rename to components/flatbutton_p.h index 1e5c899e2..1fa039407 100644 --- a/components/qtmaterialflatbutton_p.h +++ b/components/flatbutton_p.h @@ -1,9 +1,9 @@ -#ifndef QTMATERIALFLATBUTTON_P_H -#define QTMATERIALFLATBUTTON_P_H +#ifndef FLATBUTTON_P_H +#define FLATBUTTON_P_H #include #include -#include "lib/qtmaterialtheme.h" +#include "lib/theme.h" namespace md { @@ -46,4 +46,4 @@ class FlatButtonPrivate }; } -#endif // QTMATERIALFLATBUTTON_P_H +#endif // FLATBUTTON_P_H diff --git a/components/qtmaterialiconbutton.cpp b/components/iconbutton.cpp similarity index 96% rename from components/qtmaterialiconbutton.cpp rename to components/iconbutton.cpp index e86f55319..e2375dc72 100644 --- a/components/qtmaterialiconbutton.cpp +++ b/components/iconbutton.cpp @@ -1,9 +1,9 @@ -#include "qtmaterialiconbutton.h" -#include "qtmaterialiconbutton_p.h" +#include "iconbutton.h" +#include "iconbutton_p.h" #include #include -#include "lib/qtmaterialstyle.h" -#include "lib/qtmaterialrippleoverlay.h" +#include "lib/style.h" +#include "lib/rippleoverlay.h" namespace md { diff --git a/components/qtmaterialiconbutton.h b/components/iconbutton.h similarity index 90% rename from components/qtmaterialiconbutton.h rename to components/iconbutton.h index 1495743cd..f16d6ae5b 100644 --- a/components/qtmaterialiconbutton.h +++ b/components/iconbutton.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALICONBUTTON_H -#define QTMATERIALICONBUTTON_H +#ifndef ICONBUTTON_H +#define ICONBUTTON_H #include @@ -44,4 +44,4 @@ class IconButton : public QAbstractButton } -#endif // QTMATERIALICONBUTTON_H +#endif // ICONBUTTON_H diff --git a/components/qtmaterialiconbutton_p.h b/components/iconbutton_p.h similarity index 83% rename from components/qtmaterialiconbutton_p.h rename to components/iconbutton_p.h index 1d8b64277..ee27a0df4 100644 --- a/components/qtmaterialiconbutton_p.h +++ b/components/iconbutton_p.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALICONBUTTON_P_H -#define QTMATERIALICONBUTTON_P_H +#ifndef ICONBUTTON_P_H +#define ICONBUTTON_P_H #include #include @@ -30,4 +30,4 @@ class IconButtonPrivate } -#endif // QTMATERIALICONBUTTON_P_H +#endif // ICONBUTTON_P_H diff --git a/components/layouts/qtmaterialsnackbarlayout.h b/components/layouts/qtmaterialsnackbarlayout.h deleted file mode 100644 index 274166bcf..000000000 --- a/components/layouts/qtmaterialsnackbarlayout.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef QTMATERIALSNACKBARLAYOUT_H -#define QTMATERIALSNACKBARLAYOUT_H -namespace md -{ - -} -#endif // QTMATERIALSNACKBARLAYOUT_H diff --git a/components/layouts/qtmaterialsnackbarlayout_p.h b/components/layouts/qtmaterialsnackbarlayout_p.h deleted file mode 100644 index 570f62c49..000000000 --- a/components/layouts/qtmaterialsnackbarlayout_p.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef QTMATERIALSNACKBARLAYOUT_P_H -#define QTMATERIALSNACKBARLAYOUT_P_H -namespace md -{ - -} -#endif // QTMATERIALSNACKBARLAYOUT_P_H diff --git a/components/layouts/qtmaterialsnackbarlayout.cpp b/components/layouts/snackbarlayout.cpp similarity index 100% rename from components/layouts/qtmaterialsnackbarlayout.cpp rename to components/layouts/snackbarlayout.cpp diff --git a/components/layouts/snackbarlayout.h b/components/layouts/snackbarlayout.h new file mode 100644 index 000000000..6a6dedc8a --- /dev/null +++ b/components/layouts/snackbarlayout.h @@ -0,0 +1,7 @@ +#ifndef SNACKBARLAYOUT_H +#define SNACKBARLAYOUT_H +namespace md +{ + +} +#endif // SNACKBARLAYOUT_H diff --git a/components/layouts/snackbarlayout_p.h b/components/layouts/snackbarlayout_p.h new file mode 100644 index 000000000..7aa4b1cb8 --- /dev/null +++ b/components/layouts/snackbarlayout_p.h @@ -0,0 +1,7 @@ +#ifndef SNACKBARLAYOUT_P_H +#define SNACKBARLAYOUT_P_H +namespace md +{ + +} +#endif // SNACKBARLAYOUT_P_H diff --git a/components/lib/qtmaterialcheckable.cpp b/components/lib/checkable.cpp similarity index 97% rename from components/lib/qtmaterialcheckable.cpp rename to components/lib/checkable.cpp index 25ca9eb5b..d69d6cb11 100644 --- a/components/lib/qtmaterialcheckable.cpp +++ b/components/lib/checkable.cpp @@ -1,9 +1,9 @@ -#include "lib/qtmaterialcheckable.h" -#include "lib/qtmaterialcheckable_p.h" -#include "lib/qtmaterialrippleoverlay.h" -#include "lib/qtmaterialripple.h" -#include "lib/qtmaterialstyle.h" -#include "lib/qtmaterialcheckable_internal.h" +#include "lib/checkable.h" +#include "lib/checkable_p.h" +#include "lib/rippleoverlay.h" +#include "lib/ripple.h" +#include "lib/style.h" +#include "lib/checkable_internal.h" namespace md { diff --git a/components/lib/qtmaterialcheckable.h b/components/lib/checkable.h similarity index 94% rename from components/lib/qtmaterialcheckable.h rename to components/lib/checkable.h index 7ac3a86b6..aa3b800e2 100644 --- a/components/lib/qtmaterialcheckable.h +++ b/components/lib/checkable.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALCHECKABLE_H -#define QTMATERIALCHECKABLE_H +#ifndef CHECKABLE_H +#define CHECKABLE_H #include namespace md @@ -63,4 +63,4 @@ class Checkable : public QAbstractButton }; } -#endif // QTMATERIALCHECKABLE_H +#endif // CHECKABLE_H diff --git a/components/lib/qtmaterialcheckable_internal.cpp b/components/lib/checkable_internal.cpp similarity index 94% rename from components/lib/qtmaterialcheckable_internal.cpp rename to components/lib/checkable_internal.cpp index 075fba679..1977e0414 100644 --- a/components/lib/qtmaterialcheckable_internal.cpp +++ b/components/lib/checkable_internal.cpp @@ -1,8 +1,8 @@ -#include "lib/qtmaterialcheckable_internal.h" +#include "lib/checkable_internal.h" #include #include #include -#include "lib/qtmaterialcheckable.h" +#include "lib/checkable.h" namespace md { diff --git a/components/lib/qtmaterialcheckable_internal.h b/components/lib/checkable_internal.h similarity index 93% rename from components/lib/qtmaterialcheckable_internal.h rename to components/lib/checkable_internal.h index c7d3bc4cf..1aa7d9808 100644 --- a/components/lib/qtmaterialcheckable_internal.h +++ b/components/lib/checkable_internal.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALCHECKABLE_INTERNAL_H -#define QTMATERIALCHECKABLE_INTERNAL_H +#ifndef CHECKABLE_INTERNAL_H +#define CHECKABLE_INTERNAL_H #include #include @@ -93,4 +93,4 @@ inline qreal CheckableIcon::opacity() const } } -#endif // QTMATERIALCHECKABLE_INTERNAL_H +#endif // CHECKABLE_INTERNAL_H diff --git a/components/lib/qtmaterialcheckable_p.h b/components/lib/checkable_p.h similarity index 90% rename from components/lib/qtmaterialcheckable_p.h rename to components/lib/checkable_p.h index 6d199703c..5c8854774 100644 --- a/components/lib/qtmaterialcheckable_p.h +++ b/components/lib/checkable_p.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALCHECKABLE_P_H -#define QTMATERIALCHECKABLE_P_H +#ifndef CHECKABLE_P_H +#define CHECKABLE_P_H #include #include @@ -10,7 +10,7 @@ #include #include -#include "lib/qtmaterialcheckable.h" +#include "lib/checkable.h" namespace md { @@ -48,4 +48,4 @@ class CheckablePrivate }; } -#endif // QTMATERIALCHECKABLE_P_H +#endif // CHECKABLE_P_H diff --git a/components/lib/qtmaterialoverlaywidget.cpp b/components/lib/overlaywidget.cpp similarity index 96% rename from components/lib/qtmaterialoverlaywidget.cpp rename to components/lib/overlaywidget.cpp index cc2c59bfa..8bde9fc1d 100644 --- a/components/lib/qtmaterialoverlaywidget.cpp +++ b/components/lib/overlaywidget.cpp @@ -1,4 +1,4 @@ -#include "lib/qtmaterialoverlaywidget.h" +#include "lib/overlaywidget.h" #include namespace md diff --git a/components/lib/qtmaterialoverlaywidget.h b/components/lib/overlaywidget.h similarity index 79% rename from components/lib/qtmaterialoverlaywidget.h rename to components/lib/overlaywidget.h index 26914d6eb..3b6743b6a 100644 --- a/components/lib/qtmaterialoverlaywidget.h +++ b/components/lib/overlaywidget.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALOVERLAYWIDGET_H -#define QTMATERIALOVERLAYWIDGET_H +#ifndef OVERLAYWIDGET_H +#define OVERLAYWIDGET_H #include @@ -24,4 +24,4 @@ class OverlayWidget : public QWidget }; } -#endif // QTMATERIALOVERLAYWIDGET_H +#endif // OVERLAYWIDGET_H diff --git a/components/lib/qtmaterialripple.cpp b/components/lib/ripple.cpp similarity index 97% rename from components/lib/qtmaterialripple.cpp rename to components/lib/ripple.cpp index bed491b22..8488ae209 100644 --- a/components/lib/qtmaterialripple.cpp +++ b/components/lib/ripple.cpp @@ -1,5 +1,5 @@ -#include "qtmaterialripple.h" -#include "lib/qtmaterialrippleoverlay.h" +#include "ripple.h" +#include "lib/rippleoverlay.h" namespace md { diff --git a/components/lib/qtmaterialripple.h b/components/lib/ripple.h similarity index 97% rename from components/lib/qtmaterialripple.h rename to components/lib/ripple.h index 60074c59c..ac7ef6062 100644 --- a/components/lib/qtmaterialripple.h +++ b/components/lib/ripple.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALRIPPLE_H -#define QTMATERIALRIPPLE_H +#ifndef RIPPLE_H +#define RIPPLE_H #include #include @@ -136,4 +136,4 @@ inline void Ripple::setDuration(int msecs) } } -#endif // QTMATERIALRIPPLE_H +#endif // RIPPLE_H diff --git a/components/lib/qtmaterialrippleoverlay.cpp b/components/lib/rippleoverlay.cpp similarity index 95% rename from components/lib/qtmaterialrippleoverlay.cpp rename to components/lib/rippleoverlay.cpp index 2da652abd..ec0fb0c68 100644 --- a/components/lib/qtmaterialrippleoverlay.cpp +++ b/components/lib/rippleoverlay.cpp @@ -1,6 +1,6 @@ -#include "lib/qtmaterialrippleoverlay.h" +#include "lib/rippleoverlay.h" #include -#include "lib/qtmaterialripple.h" +#include "lib/ripple.h" namespace md { diff --git a/components/lib/qtmaterialrippleoverlay.h b/components/lib/rippleoverlay.h similarity index 88% rename from components/lib/qtmaterialrippleoverlay.h rename to components/lib/rippleoverlay.h index 639a9df11..d46e221ad 100644 --- a/components/lib/qtmaterialrippleoverlay.h +++ b/components/lib/rippleoverlay.h @@ -1,8 +1,8 @@ -#ifndef QTMATERIALRIPPLEOVERLAY_H -#define QTMATERIALRIPPLEOVERLAY_H +#ifndef RIPPLEOVERLAY_H +#define RIPPLEOVERLAY_H #include -#include "lib/qtmaterialoverlaywidget.h" +#include "lib/overlaywidget.h" namespace md { @@ -64,4 +64,4 @@ inline QList RippleOverlay::ripples() const } } -#endif // QTMATERIALRIPPLEOVERLAY_H +#endif // RIPPLEOVERLAY_H diff --git a/components/lib/qtmaterialstatetransition.cpp b/components/lib/statetransition.cpp similarity index 90% rename from components/lib/qtmaterialstatetransition.cpp rename to components/lib/statetransition.cpp index bbfbd16dc..3aea6fb86 100644 --- a/components/lib/qtmaterialstatetransition.cpp +++ b/components/lib/statetransition.cpp @@ -1,4 +1,4 @@ -#include "lib/qtmaterialstatetransition.h" +#include "lib/statetransition.h" namespace md { diff --git a/components/lib/qtmaterialstatetransition.h b/components/lib/statetransition.h similarity index 66% rename from components/lib/qtmaterialstatetransition.h rename to components/lib/statetransition.h index e7e317282..883c19171 100644 --- a/components/lib/qtmaterialstatetransition.h +++ b/components/lib/statetransition.h @@ -1,8 +1,8 @@ -#ifndef QTMATERIALSTATETRANSITION_H -#define QTMATERIALSTATETRANSITION_H +#ifndef STATETRANSITION_H +#define STATETRANSITION_H #include -#include "lib/qtmaterialstatetransitionevent.h" +#include "lib/statetransitionevent.h" namespace md { @@ -22,4 +22,4 @@ class StateTransition : public QAbstractTransition }; } -#endif // QTMATERIALSTATETRANSITION_H +#endif // STATETRANSITION_H diff --git a/components/lib/qtmaterialstatetransitionevent.h b/components/lib/statetransitionevent.h similarity index 87% rename from components/lib/qtmaterialstatetransitionevent.h rename to components/lib/statetransitionevent.h index c797e9243..2a9f51230 100644 --- a/components/lib/qtmaterialstatetransitionevent.h +++ b/components/lib/statetransitionevent.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALSTATETRANSITIONEVENT_H -#define QTMATERIALSTATETRANSITIONEVENT_H +#ifndef STATETRANSITIONEVENT_H +#define STATETRANSITIONEVENT_H #include @@ -42,4 +42,4 @@ struct StateTransitionEvent : public QEvent }; } -#endif // QTMATERIALSTATETRANSITIONEVENT_H +#endif // STATETRANSITIONEVENT_H diff --git a/components/lib/qtmaterialstyle.cpp b/components/lib/style.cpp similarity index 92% rename from components/lib/qtmaterialstyle.cpp rename to components/lib/style.cpp index a9f61215c..eff72a457 100644 --- a/components/lib/qtmaterialstyle.cpp +++ b/components/lib/style.cpp @@ -1,6 +1,6 @@ -#include "lib/qtmaterialstyle.h" +#include "lib/style.h" #include -#include "lib/qtmaterialtheme.h" +#include "lib/theme.h" namespace md { diff --git a/components/lib/qtmaterialstyle.h b/components/lib/style.h similarity index 84% rename from components/lib/qtmaterialstyle.h rename to components/lib/style.h index ce545dba0..6feb83beb 100644 --- a/components/lib/qtmaterialstyle.h +++ b/components/lib/style.h @@ -1,8 +1,8 @@ -#ifndef QTMATERIALSTYLE_H -#define QTMATERIALSTYLE_H +#ifndef STYLE_H +#define STYLE_H #include -#include "lib/qtmaterialstyle_p.h" +#include "lib/style_p.h" #define MATERIAL_DISABLE_THEME_COLORS \ if (d->useThemeColors == true) { d->useThemeColors = false; } @@ -40,4 +40,4 @@ inline Style &Style::instance() } } -#endif // QTMATERIALSTYLE_H +#endif // STYLE_H diff --git a/components/lib/qtmaterialstyle_p.h b/components/lib/style_p.h similarity index 75% rename from components/lib/qtmaterialstyle_p.h rename to components/lib/style_p.h index 3c1745101..d32afa01f 100644 --- a/components/lib/qtmaterialstyle_p.h +++ b/components/lib/style_p.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALSTYLE_P_H -#define QTMATERIALSTYLE_P_H +#ifndef STYLE_P_H +#define STYLE_P_H #include @@ -24,4 +24,4 @@ class StylePrivate }; } -#endif // QTMATERIALSTYLE_P_H +#endif // STYLE_P_H diff --git a/components/lib/qtmaterialtheme.cpp b/components/lib/theme.cpp similarity index 99% rename from components/lib/qtmaterialtheme.cpp rename to components/lib/theme.cpp index 4340d6ffa..9b6f057af 100644 --- a/components/lib/qtmaterialtheme.cpp +++ b/components/lib/theme.cpp @@ -1,5 +1,5 @@ -#include "lib/qtmaterialtheme.h" -#include "lib/qtmaterialtheme_p.h" +#include "lib/theme.h" +#include "lib/theme_p.h" #include #include #include diff --git a/components/lib/qtmaterialtheme.h b/components/lib/theme.h similarity index 98% rename from components/lib/qtmaterialtheme.h rename to components/lib/theme.h index 37a843456..9c25aacf5 100644 --- a/components/lib/qtmaterialtheme.h +++ b/components/lib/theme.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALTHEME_H -#define QTMATERIALTHEME_H +#ifndef THEME_H +#define THEME_H #include #include @@ -344,4 +344,4 @@ class Theme : public QObject }; } -#endif // QTMATERIALTHEME_H +#endif // THEME_H diff --git a/components/lib/qtmaterialtheme_p.h b/components/lib/theme_p.h similarity index 79% rename from components/lib/qtmaterialtheme_p.h rename to components/lib/theme_p.h index 988dabc36..4d69995bb 100644 --- a/components/lib/qtmaterialtheme_p.h +++ b/components/lib/theme_p.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALTHEME_P_H -#define QTMATERIALTHEME_P_H +#ifndef THEME_P_H +#define THEME_P_H #include #include @@ -24,4 +24,4 @@ class ThemePrivate }; } -#endif // QTMATERIALTHEME_P_H +#endif // THEME_P_H diff --git a/components/list.cpp b/components/list.cpp new file mode 100644 index 000000000..c6c6dedce --- /dev/null +++ b/components/list.cpp @@ -0,0 +1,2 @@ +#include "list.h" +#include "list_p.h" diff --git a/components/list.h b/components/list.h new file mode 100644 index 000000000..8b8d44318 --- /dev/null +++ b/components/list.h @@ -0,0 +1,4 @@ +#ifndef LIST_H +#define LIST_H + +#endif // LIST_H diff --git a/components/list_p.h b/components/list_p.h new file mode 100644 index 000000000..502ffed46 --- /dev/null +++ b/components/list_p.h @@ -0,0 +1,4 @@ +#ifndef LIST_P_H +#define LIST_P_H + +#endif // LIST_P_H diff --git a/components/listitem.cpp b/components/listitem.cpp new file mode 100644 index 000000000..4ebdbf13b --- /dev/null +++ b/components/listitem.cpp @@ -0,0 +1,2 @@ +#include "listitem.h" +#include "listitem_p.h" diff --git a/components/listitem.h b/components/listitem.h new file mode 100644 index 000000000..588e672a4 --- /dev/null +++ b/components/listitem.h @@ -0,0 +1,4 @@ +#ifndef LISTITEM_H +#define LISTITEM_H + +#endif // LISTITEM_H diff --git a/components/listitem_p.h b/components/listitem_p.h new file mode 100644 index 000000000..bc1b85a4f --- /dev/null +++ b/components/listitem_p.h @@ -0,0 +1,4 @@ +#ifndef LISTITEM_P_H +#define LISTITEM_P_H + +#endif // LISTITEM_P_H diff --git a/components/qtmaterialmenu.cpp b/components/menu.cpp similarity index 61% rename from components/qtmaterialmenu.cpp rename to components/menu.cpp index a6ff169f5..d43318003 100644 --- a/components/qtmaterialmenu.cpp +++ b/components/menu.cpp @@ -1,5 +1,5 @@ -#include "qtmaterialmenu.h" -#include "qtmaterialmenu_p.h" +#include "menu.h" +#include "menu_p.h" namespace md { diff --git a/components/qtmaterialmenu.h b/components/menu.h similarity index 67% rename from components/qtmaterialmenu.h rename to components/menu.h index c466c89f0..c07f67a80 100644 --- a/components/qtmaterialmenu.h +++ b/components/menu.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALMENU_H -#define QTMATERIALMENU_H +#ifndef MENU_H +#define MENU_H #include @@ -15,4 +15,4 @@ class Menu : public QWidget }; } -#endif // QTMATERIALMENU_H +#endif // MENU_H diff --git a/components/qtmaterialmenu_internal.cpp b/components/menu_internal.cpp similarity index 100% rename from components/qtmaterialmenu_internal.cpp rename to components/menu_internal.cpp diff --git a/components/menu_internal.h b/components/menu_internal.h new file mode 100644 index 000000000..0128af45f --- /dev/null +++ b/components/menu_internal.h @@ -0,0 +1,7 @@ +#ifndef MENU_INTERNAL_H +#define MENU_INTERNAL_H +namespace md +{ + +} +#endif // MENU_INTERNAL_H diff --git a/components/menu_p.h b/components/menu_p.h new file mode 100644 index 000000000..1226d2c82 --- /dev/null +++ b/components/menu_p.h @@ -0,0 +1,7 @@ +#ifndef MENU_P_H +#define MENU_P_H +namespace md +{ + +} +#endif // MENU_P_H diff --git a/components/paper.cpp b/components/paper.cpp new file mode 100644 index 000000000..f0c50928e --- /dev/null +++ b/components/paper.cpp @@ -0,0 +1,7 @@ +#include "paper.h" +#include "paper_p.h" + +namespace md +{ + +} diff --git a/components/paper.h b/components/paper.h new file mode 100644 index 000000000..0c9bfdf5b --- /dev/null +++ b/components/paper.h @@ -0,0 +1,7 @@ +#ifndef PAPER_H +#define PAPER_H +namespace md +{ + +} +#endif // PAPER_H diff --git a/components/paper_p.h b/components/paper_p.h new file mode 100644 index 000000000..7e53b7d66 --- /dev/null +++ b/components/paper_p.h @@ -0,0 +1,7 @@ +#ifndef PAPER_P_H +#define PAPER_P_H +namespace md +{ + +} +#endif // PAPER_P_H diff --git a/components/qtmaterialprogress.cpp b/components/progress.cpp similarity index 96% rename from components/qtmaterialprogress.cpp rename to components/progress.cpp index d4deaaa7a..16f53241f 100644 --- a/components/qtmaterialprogress.cpp +++ b/components/progress.cpp @@ -1,10 +1,10 @@ -#include "qtmaterialprogress.h" -#include "qtmaterialprogress_p.h" +#include "progress.h" +#include "progress_p.h" #include #include #include -#include "qtmaterialprogress_internal.h" -#include "lib/qtmaterialstyle.h" +#include "progress_internal.h" +#include "lib/style.h" namespace md { diff --git a/components/qtmaterialprogress.h b/components/progress.h similarity index 88% rename from components/qtmaterialprogress.h rename to components/progress.h index 44bfeafe8..c8b65698c 100644 --- a/components/qtmaterialprogress.h +++ b/components/progress.h @@ -1,8 +1,8 @@ -#ifndef QTMATERIALPROGRESS_H -#define QTMATERIALPROGRESS_H +#ifndef PROGRESS_H +#define PROGRESS_H #include -#include "lib/qtmaterialtheme.h" +#include "lib/theme.h" namespace md { @@ -42,4 +42,4 @@ class ProgressBar : public QProgressBar Q_DECLARE_PRIVATE(ProgressBar) }; } -#endif // QTMATERIALPROGRESS_H +#endif // PROGRESS_H diff --git a/components/qtmaterialprogress_internal.cpp b/components/progress_internal.cpp similarity index 87% rename from components/qtmaterialprogress_internal.cpp rename to components/progress_internal.cpp index 6b970c6ff..9bd4211d4 100644 --- a/components/qtmaterialprogress_internal.cpp +++ b/components/progress_internal.cpp @@ -1,4 +1,4 @@ -#include "qtmaterialprogress_internal.h" +#include "progress_internal.h" namespace md { diff --git a/components/qtmaterialprogress_internal.h b/components/progress_internal.h similarity index 80% rename from components/qtmaterialprogress_internal.h rename to components/progress_internal.h index 67a507f2c..d474b5725 100644 --- a/components/qtmaterialprogress_internal.h +++ b/components/progress_internal.h @@ -1,8 +1,8 @@ -#ifndef QTMATERIALPROGRESS_INTERNAL_H -#define QTMATERIALPROGRESS_INTERNAL_H +#ifndef PROGRESS_INTERNAL_H +#define PROGRESS_INTERNAL_H #include -#include "qtmaterialprogress.h" +#include "progress.h" namespace md { @@ -38,4 +38,4 @@ inline qreal ProgressBarDelegate::offset() const return m_offset; } } -#endif // QTMATERIALPROGRESS_INTERNAL_H +#endif // PROGRESS_INTERNAL_H diff --git a/components/qtmaterialprogress_p.h b/components/progress_p.h similarity index 81% rename from components/qtmaterialprogress_p.h rename to components/progress_p.h index 9256f5fce..e9b97da2a 100644 --- a/components/qtmaterialprogress_p.h +++ b/components/progress_p.h @@ -1,9 +1,9 @@ -#ifndef QTMATERIALPROGRESS_P_H -#define QTMATERIALPROGRESS_P_H +#ifndef PROGRESS_P_H +#define PROGRESS_P_H #include #include -#include "lib/qtmaterialtheme.h" +#include "lib/theme.h" namespace md { @@ -29,4 +29,4 @@ class ProgressBarPrivate bool useThemeColors; }; } -#endif // QTMATERIALPROGRESS_P_H +#endif // PROGRESS_P_H diff --git a/components/qtmateriallist.cpp b/components/qtmateriallist.cpp deleted file mode 100644 index e6b1aee44..000000000 --- a/components/qtmateriallist.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#include "qtmateriallist.h" -#include "qtmateriallist_p.h" diff --git a/components/qtmateriallist.h b/components/qtmateriallist.h deleted file mode 100644 index 7ace66ab0..000000000 --- a/components/qtmateriallist.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef QTMATERIALLIST_H -#define QTMATERIALLIST_H - -#endif // QTMATERIALLIST_H diff --git a/components/qtmateriallist_p.h b/components/qtmateriallist_p.h deleted file mode 100644 index c92b2d641..000000000 --- a/components/qtmateriallist_p.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef QTMATERIALLIST_P_H -#define QTMATERIALLIST_P_H - -#endif // QTMATERIALLIST_P_H diff --git a/components/qtmateriallistitem.cpp b/components/qtmateriallistitem.cpp deleted file mode 100644 index 67a7cd89e..000000000 --- a/components/qtmateriallistitem.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#include "qtmateriallistitem.h" -#include "qtmateriallistitem_p.h" diff --git a/components/qtmateriallistitem.h b/components/qtmateriallistitem.h deleted file mode 100644 index 9abc65bec..000000000 --- a/components/qtmateriallistitem.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef QTMATERIALLISTITEM_H -#define QTMATERIALLISTITEM_H - -#endif // QTMATERIALLISTITEM_H diff --git a/components/qtmateriallistitem_p.h b/components/qtmateriallistitem_p.h deleted file mode 100644 index fb7ebd460..000000000 --- a/components/qtmateriallistitem_p.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef QTMATERIALLISTITEM_P_H -#define QTMATERIALLISTITEM_P_H - -#endif // QTMATERIALLISTITEM_P_H diff --git a/components/qtmaterialmenu_internal.h b/components/qtmaterialmenu_internal.h deleted file mode 100644 index f9a77f10c..000000000 --- a/components/qtmaterialmenu_internal.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef QTMATERIALMENU_INTERNAL_H -#define QTMATERIALMENU_INTERNAL_H -namespace md -{ - -} -#endif // QTMATERIALMENU_INTERNAL_H diff --git a/components/qtmaterialmenu_p.h b/components/qtmaterialmenu_p.h deleted file mode 100644 index 7787c6e85..000000000 --- a/components/qtmaterialmenu_p.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef QTMATERIALMENU_P_H -#define QTMATERIALMENU_P_H -namespace md -{ - -} -#endif // QTMATERIALMENU_P_H diff --git a/components/qtmaterialpaper.cpp b/components/qtmaterialpaper.cpp deleted file mode 100644 index b0873f568..000000000 --- a/components/qtmaterialpaper.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "qtmaterialpaper.h" -#include "qtmaterialpaper_p.h" - -namespace md -{ - -} diff --git a/components/qtmaterialpaper.h b/components/qtmaterialpaper.h deleted file mode 100644 index 187a9efdf..000000000 --- a/components/qtmaterialpaper.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef QTMATERIALPAPER_H -#define QTMATERIALPAPER_H -namespace md -{ - -} -#endif // QTMATERIALPAPER_H diff --git a/components/qtmaterialpaper_p.h b/components/qtmaterialpaper_p.h deleted file mode 100644 index 5dd3d4978..000000000 --- a/components/qtmaterialpaper_p.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef QTMATERIALPAPER_P_H -#define QTMATERIALPAPER_P_H -namespace md -{ - -} -#endif // QTMATERIALPAPER_P_H diff --git a/components/qtmaterialtable.cpp b/components/qtmaterialtable.cpp deleted file mode 100644 index 7b284aa14..000000000 --- a/components/qtmaterialtable.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "qtmaterialtable.h" -#include "qtmaterialtable_p.h" -namespace md -{ - -} diff --git a/components/qtmaterialtable.h b/components/qtmaterialtable.h deleted file mode 100644 index 26f546558..000000000 --- a/components/qtmaterialtable.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef QTMATERIALTABLE_H -#define QTMATERIALTABLE_H -namespace md -{ - -} -#endif // QTMATERIALTABLE_H diff --git a/components/qtmaterialtable_p.h b/components/qtmaterialtable_p.h deleted file mode 100644 index a4c470e46..000000000 --- a/components/qtmaterialtable_p.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef QTMATERIALTABLE_P_H -#define QTMATERIALTABLE_P_H -namespace md -{ - -} -#endif // QTMATERIALTABLE_P_H diff --git a/components/qtmaterialradiobutton.cpp b/components/radiobutton.cpp similarity index 95% rename from components/qtmaterialradiobutton.cpp rename to components/radiobutton.cpp index f1800134a..d2f067d20 100644 --- a/components/qtmaterialradiobutton.cpp +++ b/components/radiobutton.cpp @@ -1,6 +1,6 @@ -#include "qtmaterialradiobutton.h" -#include "qtmaterialradiobutton_p.h" -#include "lib/qtmaterialcheckable_internal.h" +#include "radiobutton.h" +#include "radiobutton_p.h" +#include "lib/checkable_internal.h" namespace md { diff --git a/components/qtmaterialradiobutton.h b/components/radiobutton.h similarity index 68% rename from components/qtmaterialradiobutton.h rename to components/radiobutton.h index b6986a312..a63cbdc53 100644 --- a/components/qtmaterialradiobutton.h +++ b/components/radiobutton.h @@ -1,7 +1,7 @@ -#ifndef QTMATERIALRADIOBUTTON_H -#define QTMATERIALRADIOBUTTON_H +#ifndef RADIOBUTTON_H +#define RADIOBUTTON_H -#include "lib/qtmaterialcheckable.h" +#include "lib/checkable.h" namespace md { @@ -24,4 +24,4 @@ class RadioButton : public Checkable Q_DECLARE_PRIVATE(RadioButton) }; } -#endif // QTMATERIALRADIOBUTTON_H +#endif // RADIOBUTTON_H diff --git a/components/qtmaterialradiobutton_p.h b/components/radiobutton_p.h similarity index 66% rename from components/qtmaterialradiobutton_p.h rename to components/radiobutton_p.h index 0d32fea5b..fb087a2d5 100644 --- a/components/qtmaterialradiobutton_p.h +++ b/components/radiobutton_p.h @@ -1,13 +1,13 @@ -#ifndef QTMATERIALRADIOBUTTON_P_H -#define QTMATERIALRADIOBUTTON_P_H +#ifndef RADIOBUTTON_P_H +#define RADIOBUTTON_P_H #include #include #include #include -#include "qtmaterialradiobutton.h" -#include "lib/qtmaterialcheckable_p.h" +#include "radiobutton.h" +#include "lib/checkable_p.h" namespace md { @@ -26,4 +26,4 @@ class RadioButtonPrivate : public CheckablePrivate void init(); }; } -#endif // QTMATERIALRADIOBUTTON_P_H +#endif // RADIOBUTTON_P_H diff --git a/components/qtmaterialraisedbutton.cpp b/components/raisedbutton.cpp similarity index 98% rename from components/qtmaterialraisedbutton.cpp rename to components/raisedbutton.cpp index 663234653..1f15f8db8 100644 --- a/components/qtmaterialraisedbutton.cpp +++ b/components/raisedbutton.cpp @@ -1,4 +1,4 @@ -#include "qtmaterialraisedbutton_p.h" +#include "raisedbutton_p.h" namespace md { diff --git a/components/qtmaterialraisedbutton.h b/components/raisedbutton.h similarity index 77% rename from components/qtmaterialraisedbutton.h rename to components/raisedbutton.h index aa4ea94c4..0836aaa81 100644 --- a/components/qtmaterialraisedbutton.h +++ b/components/raisedbutton.h @@ -1,7 +1,7 @@ -#ifndef QTMATERIALRAISEDBUTTON_H -#define QTMATERIALRAISEDBUTTON_H +#ifndef RAISEDBUTTON_H +#define RAISEDBUTTON_H -#include "qtmaterialflatbutton.h" +#include "flatbutton.h" namespace md { @@ -27,4 +27,4 @@ class RaisedButton : public FlatButton Q_DECLARE_PRIVATE(RaisedButton) }; } -#endif // QTMATERIALRAISEDBUTTON_H +#endif // RAISEDBUTTON_H diff --git a/components/qtmaterialraisedbutton_p.h b/components/raisedbutton_p.h similarity index 76% rename from components/qtmaterialraisedbutton_p.h rename to components/raisedbutton_p.h index 615bc11c8..40b0ea13d 100644 --- a/components/qtmaterialraisedbutton_p.h +++ b/components/raisedbutton_p.h @@ -1,13 +1,13 @@ -#ifndef QTMATERIALRAISEDBUTTON_P_H -#define QTMATERIALRAISEDBUTTON_P_H +#ifndef RAISEDBUTTON_P_H +#define RAISEDBUTTON_P_H #include #include #include #include -#include "qtmaterialflatbutton_p.h" -#include "qtmaterialraisedbutton.h" +#include "flatbutton_p.h" +#include "raisedbutton.h" namespace md { @@ -31,4 +31,4 @@ class RaisedButtonPrivate : public FlatButtonPrivate QGraphicsDropShadowEffect *effect; }; } -#endif // QTMATERIALRAISEDBUTTON_P_H +#endif // RAISEDBUTTON_P_H diff --git a/components/qtmaterialscrollbar.cpp b/components/scrollbar.cpp similarity index 99% rename from components/qtmaterialscrollbar.cpp rename to components/scrollbar.cpp index 5c6a0c1b3..8b5ae5750 100644 --- a/components/qtmaterialscrollbar.cpp +++ b/components/scrollbar.cpp @@ -1,4 +1,4 @@ -#include "qtmaterialscrollbar.h" +#include "scrollbar.h" namespace md { diff --git a/components/qtmaterialscrollbar.h b/components/scrollbar.h similarity index 84% rename from components/qtmaterialscrollbar.h rename to components/scrollbar.h index 0ff4b5fcc..e44dfc3e1 100644 --- a/components/qtmaterialscrollbar.h +++ b/components/scrollbar.h @@ -1,14 +1,14 @@ -#ifndef QTMATERIALSCROLLBAR_H -#define QTMATERIALSCROLLBAR_H +#ifndef SCROLLBAR_H +#define SCROLLBAR_H #include #include #include #include -#include "qtmaterialscrollbar_p.h" -#include "qtmaterialscrollbar_internal.h" -#include "lib/qtmaterialstyle.h" +#include "scrollbar_p.h" +#include "scrollbar_internal.h" +#include "lib/style.h" namespace md { @@ -54,4 +54,4 @@ class ScrollBar : public QScrollBar Q_DECLARE_PRIVATE(ScrollBar) }; } -#endif // QTMATERIALSCROLLBAR_H +#endif // SCROLLBAR_H diff --git a/components/qtmaterialscrollbar_internal.cpp b/components/scrollbar_internal.cpp similarity index 96% rename from components/qtmaterialscrollbar_internal.cpp rename to components/scrollbar_internal.cpp index 2317f4549..f1c67d9a5 100644 --- a/components/qtmaterialscrollbar_internal.cpp +++ b/components/scrollbar_internal.cpp @@ -1,4 +1,4 @@ -#include "qtmaterialscrollbar_internal.h" +#include "scrollbar_internal.h" #include #include namespace md diff --git a/components/qtmaterialscrollbar_internal.h b/components/scrollbar_internal.h similarity index 84% rename from components/qtmaterialscrollbar_internal.h rename to components/scrollbar_internal.h index 013cd506c..1a1619486 100644 --- a/components/qtmaterialscrollbar_internal.h +++ b/components/scrollbar_internal.h @@ -1,8 +1,8 @@ -#ifndef QTMATERIALSCROLLBAR_INTERNAL_H -#define QTMATERIALSCROLLBAR_INTERNAL_H +#ifndef SCROLLBAR_INTERNAL_H +#define SCROLLBAR_INTERNAL_H #include -#include "qtmaterialscrollbar.h" +#include "scrollbar.h" namespace md { @@ -42,4 +42,4 @@ inline qreal ScrollBarStateMachine::opacity() const return m_opacity; } } -#endif // QTMATERIALSCROLLBAR_INTERNAL_H +#endif // SCROLLBAR_INTERNAL_H diff --git a/components/qtmaterialscrollbar_p.h b/components/scrollbar_p.h similarity index 86% rename from components/qtmaterialscrollbar_p.h rename to components/scrollbar_p.h index efcd191b1..08277714b 100644 --- a/components/qtmaterialscrollbar_p.h +++ b/components/scrollbar_p.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALSCROLLBAR_P_H -#define QTMATERIALSCROLLBAR_P_H +#ifndef SCROLLBAR_P_H +#define SCROLLBAR_P_H #include #include @@ -30,4 +30,4 @@ class ScrollBarPrivate bool useThemeColors; }; } -#endif // QTMATERIALSCROLLBAR_P_H +#endif // SCROLLBAR_P_H diff --git a/components/qtmaterialslider.cpp b/components/slider.cpp similarity index 97% rename from components/qtmaterialslider.cpp rename to components/slider.cpp index 797c20a46..1dd4c061b 100644 --- a/components/qtmaterialslider.cpp +++ b/components/slider.cpp @@ -1,10 +1,10 @@ -#include "qtmaterialslider.h" -#include "qtmaterialslider_p.h" +#include "slider.h" +#include "slider_p.h" #include #include -#include "qtmaterialslider_internal.h" -#include "lib/qtmaterialstyle.h" -#include "lib/qtmaterialstatetransitionevent.h" +#include "slider_internal.h" +#include "lib/style.h" +#include "lib/statetransitionevent.h" namespace md { diff --git a/components/qtmaterialslider.h b/components/slider.h similarity index 94% rename from components/qtmaterialslider.h rename to components/slider.h index 2f14e75e3..9de580972 100644 --- a/components/qtmaterialslider.h +++ b/components/slider.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALSLIDER_H -#define QTMATERIALSLIDER_H +#ifndef SLIDER_H +#define SLIDER_H #include #include @@ -58,4 +58,4 @@ class Slider : public QAbstractSlider Q_DECLARE_PRIVATE(Slider) }; } -#endif // QTMATERIALSLIDER_H +#endif // SLIDER_H diff --git a/components/qtmaterialslider_internal.cpp b/components/slider_internal.cpp similarity index 98% rename from components/qtmaterialslider_internal.cpp rename to components/slider_internal.cpp index c3a96d761..0b8c58fde 100644 --- a/components/qtmaterialslider_internal.cpp +++ b/components/slider_internal.cpp @@ -1,13 +1,13 @@ -#include "qtmaterialslider_internal.h" +#include "slider_internal.h" #include #include #include #include #include #include -#include "qtmaterialslider.h" -#include "lib/qtmaterialstyle.h" -#include "lib/qtmaterialstatetransition.h" +#include "slider.h" +#include "lib/style.h" +#include "lib/statetransition.h" namespace md { diff --git a/components/qtmaterialslider_internal.h b/components/slider_internal.h similarity index 97% rename from components/qtmaterialslider_internal.h rename to components/slider_internal.h index 756a03f2f..1f189808a 100644 --- a/components/qtmaterialslider_internal.h +++ b/components/slider_internal.h @@ -1,8 +1,8 @@ -#ifndef QTMATERIALSLIDER_INTERNAL_H -#define QTMATERIALSLIDER_INTERNAL_H +#ifndef SLIDER_INTERNAL_H +#define SLIDER_INTERNAL_H #include -#include "lib/qtmaterialoverlaywidget.h" +#include "lib/overlaywidget.h" namespace md { @@ -221,4 +221,4 @@ int SliderTrack::trackWidth() const return m_trackWidth; } } -#endif // QTMATERIALSLIDER_INTERNAL_H +#endif // SLIDER_INTERNAL_H diff --git a/components/qtmaterialslider_p.h b/components/slider_p.h similarity index 92% rename from components/qtmaterialslider_p.h rename to components/slider_p.h index d372b2fb2..313d67f30 100644 --- a/components/qtmaterialslider_p.h +++ b/components/slider_p.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALSLIDER_P_H -#define QTMATERIALSLIDER_P_H +#ifndef SLIDER_P_H +#define SLIDER_P_H #include #include @@ -49,4 +49,4 @@ class SliderPrivate bool useThemeColors; }; } -#endif // QTMATERIALSLIDER_P_H +#endif // SLIDER_P_H diff --git a/components/qtmaterialsnackbar.cpp b/components/snackbar.cpp similarity index 96% rename from components/qtmaterialsnackbar.cpp rename to components/snackbar.cpp index 7b898c113..3d76201b7 100644 --- a/components/qtmaterialsnackbar.cpp +++ b/components/snackbar.cpp @@ -1,10 +1,10 @@ -#include "qtmaterialsnackbar.h" -#include "qtmaterialsnackbar_p.h" +#include "snackbar.h" +#include "snackbar_p.h" #include #include -#include "qtmaterialsnackbar_internal.h" -#include "lib/qtmaterialstyle.h" -#include "lib/qtmaterialstatetransition.h" +#include "snackbar_internal.h" +#include "lib/style.h" +#include "lib/statetransition.h" #include namespace md { diff --git a/components/qtmaterialsnackbar.h b/components/snackbar.h similarity index 89% rename from components/qtmaterialsnackbar.h rename to components/snackbar.h index c47a2752b..c20f06bb6 100644 --- a/components/qtmaterialsnackbar.h +++ b/components/snackbar.h @@ -1,7 +1,7 @@ -#ifndef QTMATERIALSNACKBAR_H -#define QTMATERIALSNACKBAR_H +#ifndef SNACKBAR_H +#define SNACKBAR_H -#include "lib/qtmaterialoverlaywidget.h" +#include "lib/overlaywidget.h" namespace md { @@ -57,4 +57,4 @@ protected slots: Q_DECLARE_PRIVATE(SnackBar) }; } -#endif // QTMATERIALSNACKBAR_H +#endif // SNACKBAR_H diff --git a/components/qtmaterialsnackbar_internal.cpp b/components/snackbar_internal.cpp similarity index 96% rename from components/qtmaterialsnackbar_internal.cpp rename to components/snackbar_internal.cpp index cb705bc27..8d298d2a7 100644 --- a/components/qtmaterialsnackbar_internal.cpp +++ b/components/snackbar_internal.cpp @@ -1,7 +1,7 @@ -#include "qtmaterialsnackbar_internal.h" +#include "snackbar_internal.h" #include -#include "qtmaterialsnackbar.h" -#include "lib/qtmaterialstatetransition.h" +#include "snackbar.h" +#include "lib/statetransition.h" #include namespace md { diff --git a/components/qtmaterialsnackbar_internal.h b/components/snackbar_internal.h similarity index 86% rename from components/qtmaterialsnackbar_internal.h rename to components/snackbar_internal.h index 0cf3a1133..da0ed5c68 100644 --- a/components/qtmaterialsnackbar_internal.h +++ b/components/snackbar_internal.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALSNACKBAR_INTERNAL_H -#define QTMATERIALSNACKBAR_INTERNAL_H +#ifndef SNACKBAR_INTERNAL_H +#define SNACKBAR_INTERNAL_H #include #include @@ -44,4 +44,4 @@ inline qreal SnackBarStateMachine::offset() const return m_offset; } } -#endif // QTMATERIALSNACKBAR_INTERNAL_H +#endif // SNACKBAR_INTERNAL_H diff --git a/components/qtmaterialsnackbar_p.h b/components/snackbar_p.h similarity index 88% rename from components/qtmaterialsnackbar_p.h rename to components/snackbar_p.h index a24ba57d0..6a5bcba99 100644 --- a/components/qtmaterialsnackbar_p.h +++ b/components/snackbar_p.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALSNACKBAR_P_H -#define QTMATERIALSNACKBAR_P_H +#ifndef SNACKBAR_P_H +#define SNACKBAR_P_H #include #include @@ -33,4 +33,4 @@ class SnackBarPrivate bool useThemeColors; }; } -#endif // QTMATERIALSNACKBAR_P_H +#endif // SNACKBAR_P_H diff --git a/components/table.cpp b/components/table.cpp new file mode 100644 index 000000000..691d8965d --- /dev/null +++ b/components/table.cpp @@ -0,0 +1,6 @@ +#include "table.h" +#include "table_p.h" +namespace md +{ + +} diff --git a/components/table.h b/components/table.h new file mode 100644 index 000000000..66bf702d1 --- /dev/null +++ b/components/table.h @@ -0,0 +1,7 @@ +#ifndef TABLE_H +#define TABLE_H +namespace md +{ + +} +#endif // TABLE_H diff --git a/components/table_p.h b/components/table_p.h new file mode 100644 index 000000000..21164ce60 --- /dev/null +++ b/components/table_p.h @@ -0,0 +1,7 @@ +#ifndef TABLE_P_H +#define TABLE_P_H +namespace md +{ + +} +#endif // TABLE_P_H diff --git a/components/qtmaterialtabs.cpp b/components/tabs.cpp similarity index 99% rename from components/qtmaterialtabs.cpp rename to components/tabs.cpp index 04bb7742c..3f17457d7 100644 --- a/components/qtmaterialtabs.cpp +++ b/components/tabs.cpp @@ -1,4 +1,4 @@ -#include "qtmaterialtabs.h" +#include "tabs.h" namespace md { diff --git a/components/qtmaterialtabs.h b/components/tabs.h similarity index 84% rename from components/qtmaterialtabs.h rename to components/tabs.h index b3517d63f..e050ff96d 100644 --- a/components/qtmaterialtabs.h +++ b/components/tabs.h @@ -1,14 +1,14 @@ -#ifndef QTMATERIALTABS_H -#define QTMATERIALTABS_H +#ifndef TABS_H +#define TABS_H #include #include #include -#include "qtmaterialtabs_p.h" -#include "qtmaterialtabs_internal.h" -#include "lib/qtmaterialstyle.h" -#include "lib/qtmaterialtheme.h" +#include "tabs_p.h" +#include "tabs_internal.h" +#include "lib/style.h" +#include "lib/theme.h" namespace md { @@ -63,4 +63,4 @@ class Tabs : public QWidget Q_DECLARE_PRIVATE(Tabs) }; } -#endif // QTMATERIALTABS_H +#endif // TABS_H diff --git a/components/qtmaterialtabs_internal.cpp b/components/tabs_internal.cpp similarity index 99% rename from components/qtmaterialtabs_internal.cpp rename to components/tabs_internal.cpp index 951a6a1b3..dd1072d4f 100644 --- a/components/qtmaterialtabs_internal.cpp +++ b/components/tabs_internal.cpp @@ -1,4 +1,4 @@ -#include "qtmaterialtabs_internal.h" +#include "tabs_internal.h" namespace md { diff --git a/components/qtmaterialtabs_internal.h b/components/tabs_internal.h similarity index 88% rename from components/qtmaterialtabs_internal.h rename to components/tabs_internal.h index e05932e91..82f0305dc 100644 --- a/components/qtmaterialtabs_internal.h +++ b/components/tabs_internal.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALTABS_INTERNAL_H -#define QTMATERIALTABS_INTERNAL_H +#ifndef TABS_INTERNAL_H +#define TABS_INTERNAL_H #include #include @@ -8,9 +8,9 @@ #include #include -#include "qtmaterialtabs.h" -#include "lib/qtmaterialoverlaywidget.h" -#include "qtmaterialflatbutton.h" +#include "tabs.h" +#include "lib/overlaywidget.h" +#include "flatbutton.h" namespace md { @@ -95,4 +95,4 @@ inline bool Tab::isActive() const return m_active; } } -#endif // QTMATERIALTABS_INTERNAL_H +#endif // TABS_INTERNAL_H diff --git a/components/qtmaterialtabs_p.h b/components/tabs_p.h similarity index 84% rename from components/qtmaterialtabs_p.h rename to components/tabs_p.h index 2698219ed..aabf8618a 100644 --- a/components/qtmaterialtabs_p.h +++ b/components/tabs_p.h @@ -1,10 +1,10 @@ -#ifndef QTMATERIALTABS_P_H -#define QTMATERIALTABS_P_H +#ifndef TABS_P_H +#define TABS_P_H #include #include -#include "lib/qtmaterialtheme.h" +#include "lib/theme.h" namespace md { @@ -35,4 +35,4 @@ class TabsPrivate bool useThemeColors; }; } -#endif // QTMATERIALTABS_P_H +#endif // TABS_P_H diff --git a/components/qtmaterialtextfield.cpp b/components/textfield.cpp similarity index 97% rename from components/qtmaterialtextfield.cpp rename to components/textfield.cpp index 938a8116c..9c26f88ba 100644 --- a/components/qtmaterialtextfield.cpp +++ b/components/textfield.cpp @@ -1,9 +1,9 @@ -#include "qtmaterialtextfield.h" -#include "qtmaterialtextfield_p.h" +#include "textfield.h" +#include "textfield_p.h" #include #include -#include "qtmaterialtextfield_internal.h" -#include "lib/qtmaterialstyle.h" +#include "textfield_internal.h" +#include "lib/style.h" #include namespace md { diff --git a/components/qtmaterialtextfield.h b/components/textfield.h similarity index 93% rename from components/qtmaterialtextfield.h rename to components/textfield.h index 4ecd074a4..625774dfd 100644 --- a/components/qtmaterialtextfield.h +++ b/components/textfield.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALTEXTFIELD_H -#define QTMATERIALTEXTFIELD_H +#ifndef TEXTFIELD_H +#define TEXTFIELD_H #include #include @@ -61,4 +61,4 @@ class TextField : public QLineEdit Q_DECLARE_PRIVATE(TextField) }; } -#endif // QTMATERIALTEXTFIELD_H +#endif // TEXTFIELD_H diff --git a/components/qtmaterialtextfield_internal.cpp b/components/textfield_internal.cpp similarity index 99% rename from components/qtmaterialtextfield_internal.cpp rename to components/textfield_internal.cpp index be79e20fb..bb57c3639 100644 --- a/components/qtmaterialtextfield_internal.cpp +++ b/components/textfield_internal.cpp @@ -1,4 +1,4 @@ -#include "qtmaterialtextfield_internal.h" +#include "textfield_internal.h" namespace md { diff --git a/components/qtmaterialtextfield_internal.h b/components/textfield_internal.h similarity index 94% rename from components/qtmaterialtextfield_internal.h rename to components/textfield_internal.h index 0600d3158..49d86649f 100644 --- a/components/qtmaterialtextfield_internal.h +++ b/components/textfield_internal.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALTEXTFIELD_INTERNAL_H -#define QTMATERIALTEXTFIELD_INTERNAL_H +#ifndef TEXTFIELD_INTERNAL_H +#define TEXTFIELD_INTERNAL_H #include #include @@ -7,7 +7,7 @@ #include #include -#include "qtmaterialtextfield.h" +#include "textfield.h" namespace md { @@ -123,4 +123,4 @@ inline QColor TextFieldLabel::color() const return m_color; } } -#endif // QTMATERIALTEXTFIELD_INTERNAL_H +#endif // TEXTFIELD_INTERNAL_H diff --git a/components/qtmaterialtextfield_p.h b/components/textfield_p.h similarity index 90% rename from components/qtmaterialtextfield_p.h rename to components/textfield_p.h index a3682be73..bfa4d01c2 100644 --- a/components/qtmaterialtextfield_p.h +++ b/components/textfield_p.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALTEXTFIELD_P_H -#define QTMATERIALTEXTFIELD_P_H +#ifndef TEXTFIELD_P_H +#define TEXTFIELD_P_H #include #include @@ -36,4 +36,4 @@ class TextFieldPrivate }; } -#endif // QTMATERIALTEXTFIELD_P_H +#endif // TEXTFIELD_P_H diff --git a/components/qtmaterialtoggle.cpp b/components/toggle.cpp similarity index 97% rename from components/qtmaterialtoggle.cpp rename to components/toggle.cpp index dd9ebe951..a76727d29 100644 --- a/components/qtmaterialtoggle.cpp +++ b/components/toggle.cpp @@ -1,8 +1,8 @@ -#include "qtmaterialtoggle.h" +#include "toggle.h" -#include "qtmaterialtoggle_p.h" -#include "qtmaterialtoggle_internal.h" -#include "lib/qtmaterialstyle.h" +#include "toggle_p.h" +#include "toggle_internal.h" +#include "lib/style.h" namespace md { diff --git a/components/qtmaterialtoggle.h b/components/toggle.h similarity index 93% rename from components/qtmaterialtoggle.h rename to components/toggle.h index fe2efe17d..46edf79a8 100644 --- a/components/qtmaterialtoggle.h +++ b/components/toggle.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALTOGGLE_H -#define QTMATERIALTOGGLE_H +#ifndef TOGGLE_H +#define TOGGLE_H #include @@ -52,4 +52,4 @@ class Toggle : public QAbstractButton Q_DECLARE_PRIVATE(Toggle) }; } -#endif // QTMATERIALTOGGLE_H +#endif // TOGGLE_H diff --git a/components/qtmaterialtoggle_internal.cpp b/components/toggle_internal.cpp similarity index 98% rename from components/qtmaterialtoggle_internal.cpp rename to components/toggle_internal.cpp index 86f3e9160..8970f65c0 100644 --- a/components/qtmaterialtoggle_internal.cpp +++ b/components/toggle_internal.cpp @@ -1,7 +1,7 @@ -#include "qtmaterialtoggle_internal.h" +#include "toggle_internal.h" -#include "qtmaterialtoggle.h" -#include "lib/qtmaterialripple.h" +#include "toggle.h" +#include "lib/ripple.h" namespace md { diff --git a/components/qtmaterialtoggle_internal.h b/components/toggle_internal.h similarity index 94% rename from components/qtmaterialtoggle_internal.h rename to components/toggle_internal.h index 4d4494ef7..d18ea8072 100644 --- a/components/qtmaterialtoggle_internal.h +++ b/components/toggle_internal.h @@ -1,12 +1,12 @@ -#ifndef QTMATERIALTOGGLE_INTERNAL_H -#define QTMATERIALTOGGLE_INTERNAL_H +#ifndef TOGGLE_INTERNAL_H +#define TOGGLE_INTERNAL_H #include #include #include #include -#include "lib/qtmaterialrippleoverlay.h" +#include "lib/rippleoverlay.h" namespace md { @@ -124,4 +124,4 @@ inline QColor ToggleTrack::trackColor() const return m_trackColor; } } -#endif // QTMATERIALTOGGLE_INTERNAL_H +#endif // TOGGLE_INTERNAL_H diff --git a/components/qtmaterialtoggle_p.h b/components/toggle_p.h similarity index 91% rename from components/qtmaterialtoggle_p.h rename to components/toggle_p.h index bcd3b6a54..941a75c32 100644 --- a/components/qtmaterialtoggle_p.h +++ b/components/toggle_p.h @@ -1,5 +1,5 @@ -#ifndef QTMATERIALTOGGLE_P_H -#define QTMATERIALTOGGLE_P_H +#ifndef TOGGLE_P_H +#define TOGGLE_P_H #include #include @@ -42,4 +42,4 @@ class TogglePrivate bool useThemeColors; }; } -#endif // QTMATERIALTOGGLE_P_H +#endif // TOGGLE_P_H diff --git a/examples/appbarsettingseditor.h b/examples/appbarsettingseditor.h index be9dce3d2..6c5beca93 100644 --- a/examples/appbarsettingseditor.h +++ b/examples/appbarsettingseditor.h @@ -6,9 +6,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "ui_appbarsettingsform.h" diff --git a/examples/autocompletesettingseditor.h b/examples/autocompletesettingseditor.h index cbc7c3a14..44be9b300 100644 --- a/examples/autocompletesettingseditor.h +++ b/examples/autocompletesettingseditor.h @@ -8,8 +8,8 @@ #include #include -#include -#include "lib/qtmaterialoverlaywidget.h" +#include +#include "lib/overlaywidget.h" using namespace md; diff --git a/examples/avatarsettingseditor.h b/examples/avatarsettingseditor.h index eda4fe10e..655bbfa7d 100644 --- a/examples/avatarsettingseditor.h +++ b/examples/avatarsettingseditor.h @@ -4,8 +4,8 @@ #include #include -#include -#include +#include +#include #include "ui_avatarsettingsform.h" diff --git a/examples/badgesettingseditor.cpp b/examples/badgesettingseditor.cpp index 5f2be5e47..e33ed89c2 100644 --- a/examples/badgesettingseditor.cpp +++ b/examples/badgesettingseditor.cpp @@ -1,7 +1,7 @@ #include "badgesettingseditor.h" #include -#include -#include +#include +#include BadgeSettingsEditor::BadgeSettingsEditor(QWidget *parent) : QWidget(parent), diff --git a/examples/badgesettingseditor.h b/examples/badgesettingseditor.h index 3e22ae112..4c687a8c2 100644 --- a/examples/badgesettingseditor.h +++ b/examples/badgesettingseditor.h @@ -3,8 +3,8 @@ #include -#include -#include +#include +#include #include "ui_badgesettingsform.h" diff --git a/examples/checkboxsettingseditor.h b/examples/checkboxsettingseditor.h index ac0f19ad6..78243ece0 100644 --- a/examples/checkboxsettingseditor.h +++ b/examples/checkboxsettingseditor.h @@ -5,7 +5,7 @@ #include #include -#include +#include #include "ui_checkboxsettingsform.h" diff --git a/examples/circularprogresssettingseditor.h b/examples/circularprogresssettingseditor.h index e008fff4d..28c58b5cd 100644 --- a/examples/circularprogresssettingseditor.h +++ b/examples/circularprogresssettingseditor.h @@ -5,7 +5,7 @@ #include #include -#include +#include #include "ui_circularprogresssettingsform.h" diff --git a/examples/dialogsettingseditor.h b/examples/dialogsettingseditor.h index 1de0de4c7..357f36813 100644 --- a/examples/dialogsettingseditor.h +++ b/examples/dialogsettingseditor.h @@ -4,9 +4,9 @@ #include #include #include -#include +#include -#include +#include #include "ui_dialogsettingsform.h" diff --git a/examples/drawersettingseditor.h b/examples/drawersettingseditor.h index 0c5786474..2aeaf95a9 100644 --- a/examples/drawersettingseditor.h +++ b/examples/drawersettingseditor.h @@ -5,7 +5,7 @@ #include #include -#include +#include #include "ui_drawersettingsform.h" diff --git a/examples/fabsettingseditor.h b/examples/fabsettingseditor.h index 897303916..5fcf434a9 100644 --- a/examples/fabsettingseditor.h +++ b/examples/fabsettingseditor.h @@ -6,7 +6,7 @@ #include #include -#include +#include #include "ui_fabsettingsform.h" diff --git a/examples/flatbuttonsettingseditor.h b/examples/flatbuttonsettingseditor.h index 044ac99d8..56f2f2dba 100644 --- a/examples/flatbuttonsettingseditor.h +++ b/examples/flatbuttonsettingseditor.h @@ -5,7 +5,7 @@ #include #include -#include +#include #include "ui_flatbuttonsettingsform.h" diff --git a/examples/iconbuttonsettingseditor.h b/examples/iconbuttonsettingseditor.h index 275f2e2b5..9ef9e2670 100644 --- a/examples/iconbuttonsettingseditor.h +++ b/examples/iconbuttonsettingseditor.h @@ -4,8 +4,8 @@ #include #include -#include -#include +#include +#include #include "ui_iconbuttonsettingsform.h" diff --git a/examples/menusettingseditor.h b/examples/menusettingseditor.h index d6ecc431c..1a64f5418 100644 --- a/examples/menusettingseditor.h +++ b/examples/menusettingseditor.h @@ -5,8 +5,8 @@ #include #include -#include -#include "lib/qtmaterialoverlaywidget.h" +#include +#include "lib/overlaywidget.h" //#include "ui_menusettingsform.h" diff --git a/examples/progresssettingseditor.h b/examples/progresssettingseditor.h index fcd63172c..d0d89bf50 100644 --- a/examples/progresssettingseditor.h +++ b/examples/progresssettingseditor.h @@ -4,8 +4,8 @@ #include #include -#include -#include +#include +#include #include "ui_progresssettingsform.h" diff --git a/examples/radiobuttonsettingseditor.h b/examples/radiobuttonsettingseditor.h index 3625a175d..1a3f9d4ee 100644 --- a/examples/radiobuttonsettingseditor.h +++ b/examples/radiobuttonsettingseditor.h @@ -6,7 +6,7 @@ #include #include -#include +#include #include "ui_radiobuttonsettingsform.h" diff --git a/examples/raisedbuttonsettingseditor.h b/examples/raisedbuttonsettingseditor.h index 225292e52..95babf356 100644 --- a/examples/raisedbuttonsettingseditor.h +++ b/examples/raisedbuttonsettingseditor.h @@ -1,7 +1,7 @@ #ifndef RAISEDBUTTONSETTINGSEDITOR_H #define RAISEDBUTTONSETTINGSEDITOR_H -#include +#include #include "flatbuttonsettingseditor.h" using namespace md; diff --git a/examples/scrollbarsettingseditor.h b/examples/scrollbarsettingseditor.h index 971d12e4d..3b6fced5d 100644 --- a/examples/scrollbarsettingseditor.h +++ b/examples/scrollbarsettingseditor.h @@ -6,7 +6,7 @@ #include #include -#include +#include #include "ui_scrollbarsettingsform.h" diff --git a/examples/slidersettingseditor.h b/examples/slidersettingseditor.h index fdd3d9f6a..0bb69d91f 100644 --- a/examples/slidersettingseditor.h +++ b/examples/slidersettingseditor.h @@ -5,7 +5,7 @@ #include #include -#include +#include #include "ui_slidersettingsform.h" diff --git a/examples/snackbarsettingseditor.h b/examples/snackbarsettingseditor.h index e51c163df..01d02dba6 100644 --- a/examples/snackbarsettingseditor.h +++ b/examples/snackbarsettingseditor.h @@ -5,7 +5,7 @@ #include #include -#include +#include #include "ui_snackbarsettingsform.h" diff --git a/examples/tabssettingseditor.h b/examples/tabssettingseditor.h index 806a4cdb6..02fa82176 100644 --- a/examples/tabssettingseditor.h +++ b/examples/tabssettingseditor.h @@ -5,7 +5,7 @@ #include #include -#include +#include #include "ui_tabssettingsform.h" diff --git a/examples/textfieldsettingseditor.h b/examples/textfieldsettingseditor.h index cc01a1c8d..90bd4b64a 100644 --- a/examples/textfieldsettingseditor.h +++ b/examples/textfieldsettingseditor.h @@ -5,7 +5,7 @@ #include #include -#include +#include #include "ui_textfieldsettingsform.h" diff --git a/examples/togglesettingseditor.h b/examples/togglesettingseditor.h index 435c76c2b..e5e20fd73 100644 --- a/examples/togglesettingseditor.h +++ b/examples/togglesettingseditor.h @@ -4,7 +4,7 @@ #include #include -#include +#include #include "ui_togglesettingsform.h" From 5b1269dcfa420c5433d57cfe21ba6fa8d47614ac Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 17:52:34 +0100 Subject: [PATCH 40/46] Copying Fonts/Assets/Icons folders to build dir. fonts ----> app_build/ assets ---> app_build/examples/ icons ----> app_build/components/ --- CMakeLists.txt | 18 ++---------------- components/CMakeLists.txt | 7 ++++--- examples/CMakeLists.txt | 15 ++++----------- 3 files changed, 10 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c6d4c75ec..771bc95b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,18 +12,10 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED) -find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) -find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Gui REQUIRED) -find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED) -find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core5Compat REQUIRED) add_subdirectory(components) add_subdirectory(examples) -#set(PROJECT_SOURCES - -#) - if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) # qt_add_executable(QtMaterialWidgets # MANUAL_FINALIZATION @@ -35,9 +27,7 @@ if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) # For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation else() if(ANDROID) - add_library(QtMaterialWidgets SHARED - ${PROJECT_SOURCES} - ) + add_library(QtMaterialWidgets SHARED ${PROJECT_SOURCES}) # Define properties for Android with Qt 5 after find_package() calls as: # set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android") else() @@ -47,10 +37,6 @@ else() endif() endif() -#target_link_libraries(QtMaterialWidgets PRIVATE Qt${QT_VERSION_MAJOR}::Core) -#target_link_libraries(QtMaterialWidgets PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) -#target_link_libraries(QtMaterialWidgets PRIVATE Qt${QT_VERSION_MAJOR}::Core5Compat) - #set_target_properties(QtMaterialWidgets PROPERTIES # MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com @@ -60,7 +46,7 @@ endif() # WIN32_EXECUTABLE TRUE #) -#file(COPY assets DESTINATION ${CMAKE_BINARY_DIR}) +file(COPY fonts DESTINATION ${CMAKE_BINARY_DIR}) if(QT_VERSION_MAJOR EQUAL 6) # qt_finalize_executable(QtMaterialWidgets) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index f745584be..29c85a749 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -21,6 +21,7 @@ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS StateMachine REQUIRED) # Create a library called "components" which includes the source file "*.cpp". # The extension is already found. Any number of sources could be listed here. set(PROJECT_SOURCES +# sources avatar.cpp lib/style.cpp lib/theme.cpp @@ -68,6 +69,7 @@ set(PROJECT_SOURCES menu_internal.cpp list.cpp listitem.cpp +# headers avatar_p.h avatar.h lib/style_p.h @@ -169,11 +171,10 @@ target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::Gui) target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::Core5Compat) target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::StateMachine) -# Make sure the compiler can find include files for our components library +# Make sure the compiler can find include files for our 'components' library # when other libraries or executables link to components target_include_directories (components PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) - set_target_properties(components PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} @@ -182,7 +183,7 @@ set_target_properties(components PROPERTIES WIN32_EXECUTABLE TRUE ) -file(COPY icons DESTINATION ${CMAKE_BINARY_DIR}) +file(COPY icons DESTINATION ${CMAKE_BINARY_DIR}/components) if(QT_VERSION_MAJOR EQUAL 6) # qt_finalize_executable(components) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index d3be2fc71..3022a7ff9 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -90,25 +90,18 @@ set(PROJECT_SOURCES ) if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) - qt_add_executable(examples - MANUAL_FINALIZATION - ${PROJECT_SOURCES} - ) + qt_add_executable(examples MANUAL_FINALIZATION ${PROJECT_SOURCES}) # Define target properties for Android with Qt 6 as: # set_property(TARGET examples APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR # ${CMAKE_CURRENT_SOURCE_DIR}/android) # For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation else() if(ANDROID) - add_library(examples SHARED - ${PROJECT_SOURCES} - ) + add_library(examples SHARED ${PROJECT_SOURCES}) # Define properties for Android with Qt 5 after find_package() calls as: # set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android") else() - add_executable(examples - ${PROJECT_SOURCES} - ) + add_executable(examples ${PROJECT_SOURCES}) endif() endif() @@ -133,7 +126,7 @@ set_target_properties(examples PROPERTIES WIN32_EXECUTABLE TRUE ) -file(COPY assets DESTINATION ${CMAKE_BINARY_DIR}) +file(COPY assets DESTINATION ${CMAKE_BINARY_DIR}/examples) if(QT_VERSION_MAJOR EQUAL 6) qt_finalize_executable(examples) From e04298e24ec385715386813195410e041dd26544 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Thu, 17 Feb 2022 17:54:26 +0100 Subject: [PATCH 41/46] Locate resources at runtime using QDir::currentpath --- components/appbar.cpp | 4 +--- components/appbar_p.h | 2 ++ components/autocomplete_internal.cpp | 6 +----- components/autocomplete_internal.h | 5 +++++ components/avatar.cpp | 4 +--- components/avatar_p.h | 3 +++ components/badge.cpp | 3 +-- components/badge_p.h | 1 + components/circularprogress.cpp | 6 +----- components/circularprogress_p.h | 6 ++++++ components/dialog_internal.cpp | 2 +- components/drawer_internal.cpp | 8 ++------ components/drawer_internal.h | 7 ++++++- components/fab.cpp | 7 ++----- components/fab_p.h | 6 ++++++ components/lib/checkable.cpp | 6 +++--- components/lib/checkable_p.h | 1 + components/lib/overlaywidget.cpp | 2 +- components/lib/ripple.cpp | 2 +- components/lib/style.cpp | 11 +++++------ components/lib/style_p.h | 2 ++ components/lib/theme.cpp | 10 ++++------ components/lib/theme_p.h | 4 ++++ examples/avatarsettingseditor.cpp | 3 ++- examples/avatarsettingseditor.h | 3 ++- examples/badgesettingseditor.cpp | 5 +---- examples/badgesettingseditor.h | 2 ++ 27 files changed, 67 insertions(+), 54 deletions(-) diff --git a/components/appbar.cpp b/components/appbar.cpp index 557765b34..6b8103d95 100644 --- a/components/appbar.cpp +++ b/components/appbar.cpp @@ -1,12 +1,10 @@ #include "appbar.h" #include "appbar_p.h" -#include -#include #include "lib/style.h" namespace md { /*! - * \class QtMaterialAppBarPrivate + * \class AppBarPrivate * \internal */ diff --git a/components/appbar_p.h b/components/appbar_p.h index 85e2c55af..dcb1cb2f9 100644 --- a/components/appbar_p.h +++ b/components/appbar_p.h @@ -3,6 +3,8 @@ #include #include +#include +#include namespace md { diff --git a/components/autocomplete_internal.cpp b/components/autocomplete_internal.cpp index 7fff61bd9..621dbc982 100644 --- a/components/autocomplete_internal.cpp +++ b/components/autocomplete_internal.cpp @@ -1,13 +1,9 @@ #include "autocomplete_internal.h" -#include -#include -#include -#include namespace md { /*! - * \class QtMaterialAutoCompleteStateMachine + * \class AutoCompleteStateMachine * \internal */ diff --git a/components/autocomplete_internal.h b/components/autocomplete_internal.h index d628b553c..a913eca2b 100644 --- a/components/autocomplete_internal.h +++ b/components/autocomplete_internal.h @@ -1,7 +1,12 @@ #ifndef AUTOCOMPLETESTATEMACHINE_H #define AUTOCOMPLETESTATEMACHINE_H +#include #include +#include +#include +#include + #include "autocomplete.h" namespace md diff --git a/components/avatar.cpp b/components/avatar.cpp index c1d0ea20f..ef3bfb77a 100644 --- a/components/avatar.cpp +++ b/components/avatar.cpp @@ -1,13 +1,11 @@ #include "avatar.h" #include "avatar_p.h" -#include -#include #include "lib/style.h" namespace md { /*! - * \class QtMaterialAvatarPrivate + * \class AvatarPrivate * \internal */ diff --git a/components/avatar_p.h b/components/avatar_p.h index 5901b24f5..127496b9b 100644 --- a/components/avatar_p.h +++ b/components/avatar_p.h @@ -7,6 +7,9 @@ #include #include #include +#include +#include + #include "lib/theme.h" namespace md diff --git a/components/badge.cpp b/components/badge.cpp index f6dff5ab4..0461c3eff 100644 --- a/components/badge.cpp +++ b/components/badge.cpp @@ -1,13 +1,12 @@ #include "badge.h" #include "badge_p.h" -#include #include "lib/style.h" namespace md { /*! - * \class QtMaterialBadgePrivate + * \class BadgePrivate * \internal */ diff --git a/components/badge_p.h b/components/badge_p.h index 89a110fcb..b4a98c9cf 100644 --- a/components/badge_p.h +++ b/components/badge_p.h @@ -5,6 +5,7 @@ #include #include #include +#include namespace md { diff --git a/components/circularprogress.cpp b/components/circularprogress.cpp index 2203a2eb3..32849799f 100644 --- a/components/circularprogress.cpp +++ b/components/circularprogress.cpp @@ -1,9 +1,5 @@ #include "circularprogress.h" #include "circularprogress_p.h" -#include -#include -#include -#include #include "circularprogress_internal.h" #include "lib/style.h" @@ -11,7 +7,7 @@ namespace md { /*! - * \class QtMaterialCircularProgressPrivate + * \class CircularProgressPrivate * \internal */ diff --git a/components/circularprogress_p.h b/components/circularprogress_p.h index ad229305b..5f5f05123 100644 --- a/components/circularprogress_p.h +++ b/components/circularprogress_p.h @@ -2,7 +2,13 @@ #define CIRCULARPROGRESS_P_H #include +#include +#include +#include +#include + #include "lib/theme.h" + namespace md { diff --git a/components/dialog_internal.cpp b/components/dialog_internal.cpp index 1e58c7e0e..167c62315 100644 --- a/components/dialog_internal.cpp +++ b/components/dialog_internal.cpp @@ -82,7 +82,7 @@ void DialogProxy::paintEvent(QPaintEvent *event) } /*! - * \class QtMaterialDialogWindow + * \class DialogWindow * \internal */ diff --git a/components/drawer_internal.cpp b/components/drawer_internal.cpp index 3e2f1e777..62308c920 100644 --- a/components/drawer_internal.cpp +++ b/components/drawer_internal.cpp @@ -1,14 +1,10 @@ #include "drawer_internal.h" -#include -#include -#include -#include -#include #include "drawer.h" + namespace md { /*! - * \class QtMaterialDrawerStateMachine + * \class DrawerStateMachine * \internal */ diff --git a/components/drawer_internal.h b/components/drawer_internal.h index 537017947..dea6fb8a4 100644 --- a/components/drawer_internal.h +++ b/components/drawer_internal.h @@ -2,6 +2,12 @@ #define DRAWER_INTERNAL_H #include +#include +#include +#include +#include +#include + #include "lib/overlaywidget.h" namespace md @@ -52,7 +58,6 @@ inline qreal DrawerStateMachine::opacity() const class DrawerWidget : public OverlayWidget { Q_OBJECT - Q_PROPERTY(int offset WRITE setOffset READ offset) public: diff --git a/components/fab.cpp b/components/fab.cpp index 0e57f68f3..0d4212379 100644 --- a/components/fab.cpp +++ b/components/fab.cpp @@ -1,15 +1,12 @@ #include "fab.h" #include "fab_p.h" -#include -#include -#include -#include #include "lib/rippleoverlay.h" + namespace md { /*! - * \class QtMaterialFloatingActionButtonPrivate + * \class FloatingActionButtonPrivate * \internal */ diff --git a/components/fab_p.h b/components/fab_p.h index 9055fd1a6..2e784bb33 100644 --- a/components/fab_p.h +++ b/components/fab_p.h @@ -1,7 +1,13 @@ #ifndef FAB_P_H #define FAB_P_H +#include +#include +#include +#include + #include "raisedbutton_p.h" + namespace md { diff --git a/components/lib/checkable.cpp b/components/lib/checkable.cpp index d69d6cb11..e160afd6d 100644 --- a/components/lib/checkable.cpp +++ b/components/lib/checkable.cpp @@ -8,7 +8,7 @@ namespace md { /*! - * \class QtMaterialCheckablePrivate + * \class CheckablePrivate * \internal */ @@ -26,8 +26,8 @@ void CheckablePrivate::init() Q_Q(Checkable); rippleOverlay = new RippleOverlay; - checkedIcon = new CheckableIcon(QIcon(":/icons/icons/toggle/svg/production/ic_check_box_24px.svg"), q); - uncheckedIcon = new CheckableIcon(QIcon(":/icons/icons/toggle/svg/production/ic_check_box_outline_blank_24px.svg"), q); + checkedIcon = new CheckableIcon(QIcon(QDir::currentPath()+"/../components/icons/toggle/svg/production/ic_check_box_24px.svg"), q); + uncheckedIcon = new CheckableIcon(QIcon(QDir::currentPath()+"/../components/icons/toggle/svg/production/ic_check_box_outline_blank_24px.svg"), q); stateMachine = new QStateMachine(q); uncheckedState = new QState; checkedState = new QState; diff --git a/components/lib/checkable_p.h b/components/lib/checkable_p.h index 5c8854774..2fb61fd5e 100644 --- a/components/lib/checkable_p.h +++ b/components/lib/checkable_p.h @@ -9,6 +9,7 @@ #include #include #include +#include #include "lib/checkable.h" diff --git a/components/lib/overlaywidget.cpp b/components/lib/overlaywidget.cpp index 8bde9fc1d..1dd5deb1f 100644 --- a/components/lib/overlaywidget.cpp +++ b/components/lib/overlaywidget.cpp @@ -4,7 +4,7 @@ namespace md { /*! - * \class QtMaterialOverlayWidget + * \class OverlayWidget * \internal */ diff --git a/components/lib/ripple.cpp b/components/lib/ripple.cpp index 8488ae209..6fcc6e7c1 100644 --- a/components/lib/ripple.cpp +++ b/components/lib/ripple.cpp @@ -4,7 +4,7 @@ namespace md { /*! - * \class QtMaterialRipple + * \class Ripple * \internal */ diff --git a/components/lib/style.cpp b/components/lib/style.cpp index eff72a457..e3838bdda 100644 --- a/components/lib/style.cpp +++ b/components/lib/style.cpp @@ -1,11 +1,10 @@ #include "lib/style.h" -#include #include "lib/theme.h" namespace md { /*! - * \class QtMaterialStylePrivate + * \class StylePrivate * \internal */ @@ -22,15 +21,15 @@ void StylePrivate::init() { Q_Q(Style); - QFontDatabase::addApplicationFont(":/fonts/roboto_regular"); - QFontDatabase::addApplicationFont(":/fonts/roboto_medium"); - QFontDatabase::addApplicationFont(":/fonts/roboto_bold"); + QFontDatabase::addApplicationFont(QDir::currentPath()+"/../fonts/roboto_regular"); + QFontDatabase::addApplicationFont(QDir::currentPath()+"/../fonts/roboto_medium"); + QFontDatabase::addApplicationFont(QDir::currentPath()+"/../fonts/roboto_bold"); q->setTheme(new Theme); } /*! - * \class QtMaterialStyle + * \class Style * \internal */ diff --git a/components/lib/style_p.h b/components/lib/style_p.h index d32afa01f..f262d5912 100644 --- a/components/lib/style_p.h +++ b/components/lib/style_p.h @@ -2,6 +2,8 @@ #define STYLE_P_H #include +#include +#include namespace md { diff --git a/components/lib/theme.cpp b/components/lib/theme.cpp index 9b6f057af..ea1e1a0bf 100644 --- a/components/lib/theme.cpp +++ b/components/lib/theme.cpp @@ -1,12 +1,10 @@ #include "lib/theme.h" #include "lib/theme_p.h" -#include -#include -#include + namespace md { -/*!material - * \class QtMaterialThemePrivate +/*! + * \class ThemePrivate * \internal */ @@ -156,7 +154,7 @@ void Theme::setColor(const QString &key, Material::Color color) QIcon Theme::icon(QString category, QString icon) { - return QIcon(":/icons/icons/" % category % "/svg/production/ic_" % icon % "_24px.svg"); + return QIcon(QDir::currentPath() % "/../components/icons/" % category % "/svg/production/ic_" % icon % "_24px.svg"); } } diff --git a/components/lib/theme_p.h b/components/lib/theme_p.h index 4d69995bb..43e45661a 100644 --- a/components/lib/theme_p.h +++ b/components/lib/theme_p.h @@ -3,6 +3,10 @@ #include #include +#include +#include +#include +#include namespace md { diff --git a/examples/avatarsettingseditor.cpp b/examples/avatarsettingseditor.cpp index 2ae95ce17..a2f58ce32 100644 --- a/examples/avatarsettingseditor.cpp +++ b/examples/avatarsettingseditor.cpp @@ -70,7 +70,8 @@ void AvatarSettingsEditor::updateWidget() m_avatar->setLetter(QChar('X')); break; case 1: - m_avatar->setImage(QImage(":/images/assets/sikh.jpg")); + qDebug()<setImage(QImage(QDir::currentPath()+"/assets/sikh.jpg")); break; case 2: m_avatar->setIcon(Theme::icon("communication", "message")); diff --git a/examples/avatarsettingseditor.h b/examples/avatarsettingseditor.h index 655bbfa7d..5a909d2b4 100644 --- a/examples/avatarsettingseditor.h +++ b/examples/avatarsettingseditor.h @@ -2,8 +2,9 @@ #define AVATARSETTINGSEDITOR_H #include - #include +#include + #include #include diff --git a/examples/badgesettingseditor.cpp b/examples/badgesettingseditor.cpp index e33ed89c2..bdf4f2292 100644 --- a/examples/badgesettingseditor.cpp +++ b/examples/badgesettingseditor.cpp @@ -1,12 +1,9 @@ #include "badgesettingseditor.h" -#include -#include -#include BadgeSettingsEditor::BadgeSettingsEditor(QWidget *parent) : QWidget(parent), ui(new Ui::BadgeSettingsForm), - m_avatar(new Avatar(QImage(":/images/assets/sikh.jpg"))), + m_avatar(new Avatar(QImage(QDir::currentPath()+"/assets/sikh.jpg"))), m_badge(new Badge) { QVBoxLayout *layout = new QVBoxLayout; diff --git a/examples/badgesettingseditor.h b/examples/badgesettingseditor.h index 4c687a8c2..26446000d 100644 --- a/examples/badgesettingseditor.h +++ b/examples/badgesettingseditor.h @@ -2,6 +2,8 @@ #define BADGESETTINGSEDITOR_H #include +#include +#include #include #include From f345d3a67263b8dcd75f03f55f547bb509ff73ca Mon Sep 17 00:00:00 2001 From: Achraf k <5377154+ashraf-kx@users.noreply.github.com> Date: Thu, 17 Feb 2022 17:56:23 +0100 Subject: [PATCH 42/46] Delete .qmake.conf --- .qmake.conf | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .qmake.conf diff --git a/.qmake.conf b/.qmake.conf deleted file mode 100644 index b303d719d..000000000 --- a/.qmake.conf +++ /dev/null @@ -1,2 +0,0 @@ -top_srcdir=$$PWD -top_builddir=$$shadowed($$PWD) From 3608731285ff0f8113064eec24b1c7c128200f59 Mon Sep 17 00:00:00 2001 From: Achraf k <5377154+ashraf-kx@users.noreply.github.com> Date: Sat, 19 Feb 2022 13:31:00 +0100 Subject: [PATCH 43/46] Update README.md --- README.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index c73eed0dd..bc98449df 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU App Bar - QtMaterialAppBar + md::AppBar @@ -38,7 +38,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU Avatar - QtMaterialAvatar + md::Avatar @@ -51,7 +51,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU Badge - QtMaterialBadge + md::Badge @@ -64,7 +64,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU Check Box - QtMaterialCheckBox + md::CheckBox @@ -77,7 +77,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU Circular Progress - QtMaterialCircularProgress + md::CircularProgress @@ -90,7 +90,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU Dialog - QtMaterialDialog + md::Dialog @@ -103,7 +103,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU Drawer - QtMaterialDrawer + md::Drawer @@ -116,7 +116,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU FAB - QtMaterialFloatingActionButton + md::FloatingActionButton @@ -129,7 +129,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU Flat Button - QtMaterialFlatButton + md::FlatButton @@ -155,7 +155,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU Progress - QtMaterialProgress + md::Progress @@ -168,7 +168,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU Radio Button - QtMaterialRadioButton + md::RadioButton @@ -181,7 +181,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU Raised Button - QtMaterialRaisedButton + md::RaisedButton @@ -194,7 +194,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU Scroll Bar - QtMaterialScrollBar + md::ScrollBar @@ -207,7 +207,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU Slider - QtMaterialSlider + md::Slider @@ -220,7 +220,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU Snackbar - QtMaterialSnackBar + md::SnackBar @@ -233,7 +233,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU Tabs - QtMaterialTabs + md::Tabs @@ -246,7 +246,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU Text Field - QtMaterialTextField + md::TextField @@ -259,7 +259,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU Toggle - QtMaterialToggle + md::Toggle From 872b74e5fc5405e64ca677b594801a88db01269a Mon Sep 17 00:00:00 2001 From: Achraf k <5377154+ashraf-kx@users.noreply.github.com> Date: Sat, 19 Feb 2022 13:31:34 +0100 Subject: [PATCH 44/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bc98449df..f4746c7e8 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ YouTube video preview [available here](http://www.youtube.com/watch?v=21UMeNVBPU Auto Complete - QtMaterialAutoComplete + md::AutoComplete From 4b233f2951102169b5e8ff8dedb6ce14be328712 Mon Sep 17 00:00:00 2001 From: Achraf k Date: Mon, 21 Feb 2022 21:02:09 +0100 Subject: [PATCH 45/46] move fonts folder inside the components directory. --- {fonts => components/fonts}/Roboto/LICENSE.txt | 0 {fonts => components/fonts}/Roboto/Roboto-Black.ttf | Bin .../fonts}/Roboto/Roboto-BlackItalic.ttf | Bin {fonts => components/fonts}/Roboto/Roboto-Bold.ttf | Bin .../fonts}/Roboto/Roboto-BoldItalic.ttf | Bin .../fonts}/Roboto/Roboto-Italic.ttf | Bin {fonts => components/fonts}/Roboto/Roboto-Light.ttf | Bin .../fonts}/Roboto/Roboto-LightItalic.ttf | Bin .../fonts}/Roboto/Roboto-Medium.ttf | Bin .../fonts}/Roboto/Roboto-MediumItalic.ttf | Bin .../fonts}/Roboto/Roboto-Regular.ttf | Bin {fonts => components/fonts}/Roboto/Roboto-Thin.ttf | Bin .../fonts}/Roboto/Roboto-ThinItalic.ttf | Bin 13 files changed, 0 insertions(+), 0 deletions(-) rename {fonts => components/fonts}/Roboto/LICENSE.txt (100%) rename {fonts => components/fonts}/Roboto/Roboto-Black.ttf (100%) rename {fonts => components/fonts}/Roboto/Roboto-BlackItalic.ttf (100%) rename {fonts => components/fonts}/Roboto/Roboto-Bold.ttf (100%) rename {fonts => components/fonts}/Roboto/Roboto-BoldItalic.ttf (100%) rename {fonts => components/fonts}/Roboto/Roboto-Italic.ttf (100%) rename {fonts => components/fonts}/Roboto/Roboto-Light.ttf (100%) rename {fonts => components/fonts}/Roboto/Roboto-LightItalic.ttf (100%) rename {fonts => components/fonts}/Roboto/Roboto-Medium.ttf (100%) rename {fonts => components/fonts}/Roboto/Roboto-MediumItalic.ttf (100%) rename {fonts => components/fonts}/Roboto/Roboto-Regular.ttf (100%) rename {fonts => components/fonts}/Roboto/Roboto-Thin.ttf (100%) rename {fonts => components/fonts}/Roboto/Roboto-ThinItalic.ttf (100%) diff --git a/fonts/Roboto/LICENSE.txt b/components/fonts/Roboto/LICENSE.txt similarity index 100% rename from fonts/Roboto/LICENSE.txt rename to components/fonts/Roboto/LICENSE.txt diff --git a/fonts/Roboto/Roboto-Black.ttf b/components/fonts/Roboto/Roboto-Black.ttf similarity index 100% rename from fonts/Roboto/Roboto-Black.ttf rename to components/fonts/Roboto/Roboto-Black.ttf diff --git a/fonts/Roboto/Roboto-BlackItalic.ttf b/components/fonts/Roboto/Roboto-BlackItalic.ttf similarity index 100% rename from fonts/Roboto/Roboto-BlackItalic.ttf rename to components/fonts/Roboto/Roboto-BlackItalic.ttf diff --git a/fonts/Roboto/Roboto-Bold.ttf b/components/fonts/Roboto/Roboto-Bold.ttf similarity index 100% rename from fonts/Roboto/Roboto-Bold.ttf rename to components/fonts/Roboto/Roboto-Bold.ttf diff --git a/fonts/Roboto/Roboto-BoldItalic.ttf b/components/fonts/Roboto/Roboto-BoldItalic.ttf similarity index 100% rename from fonts/Roboto/Roboto-BoldItalic.ttf rename to components/fonts/Roboto/Roboto-BoldItalic.ttf diff --git a/fonts/Roboto/Roboto-Italic.ttf b/components/fonts/Roboto/Roboto-Italic.ttf similarity index 100% rename from fonts/Roboto/Roboto-Italic.ttf rename to components/fonts/Roboto/Roboto-Italic.ttf diff --git a/fonts/Roboto/Roboto-Light.ttf b/components/fonts/Roboto/Roboto-Light.ttf similarity index 100% rename from fonts/Roboto/Roboto-Light.ttf rename to components/fonts/Roboto/Roboto-Light.ttf diff --git a/fonts/Roboto/Roboto-LightItalic.ttf b/components/fonts/Roboto/Roboto-LightItalic.ttf similarity index 100% rename from fonts/Roboto/Roboto-LightItalic.ttf rename to components/fonts/Roboto/Roboto-LightItalic.ttf diff --git a/fonts/Roboto/Roboto-Medium.ttf b/components/fonts/Roboto/Roboto-Medium.ttf similarity index 100% rename from fonts/Roboto/Roboto-Medium.ttf rename to components/fonts/Roboto/Roboto-Medium.ttf diff --git a/fonts/Roboto/Roboto-MediumItalic.ttf b/components/fonts/Roboto/Roboto-MediumItalic.ttf similarity index 100% rename from fonts/Roboto/Roboto-MediumItalic.ttf rename to components/fonts/Roboto/Roboto-MediumItalic.ttf diff --git a/fonts/Roboto/Roboto-Regular.ttf b/components/fonts/Roboto/Roboto-Regular.ttf similarity index 100% rename from fonts/Roboto/Roboto-Regular.ttf rename to components/fonts/Roboto/Roboto-Regular.ttf diff --git a/fonts/Roboto/Roboto-Thin.ttf b/components/fonts/Roboto/Roboto-Thin.ttf similarity index 100% rename from fonts/Roboto/Roboto-Thin.ttf rename to components/fonts/Roboto/Roboto-Thin.ttf diff --git a/fonts/Roboto/Roboto-ThinItalic.ttf b/components/fonts/Roboto/Roboto-ThinItalic.ttf similarity index 100% rename from fonts/Roboto/Roboto-ThinItalic.ttf rename to components/fonts/Roboto/Roboto-ThinItalic.ttf From 851d3fb7b56695a9181e3ea373f3d9e4015c15df Mon Sep 17 00:00:00 2001 From: Achraf k Date: Mon, 21 Feb 2022 21:07:17 +0100 Subject: [PATCH 46/46] Qt Resource System for shipping resource files. --- CMakeLists.txt | 2 +- components/CMakeLists.txt | 4 +- components/lib/checkable.cpp | 4 +- components/lib/checkable_p.h | 1 - components/lib/style.cpp | 6 +- components/lib/style_p.h | 1 - components/lib/theme.cpp | 2 +- components/lib/theme_p.h | 1 - components/resources.qrc | 978 +++++++++++++++++++++++++++++++++++ 9 files changed, 987 insertions(+), 12 deletions(-) create mode 100644 components/resources.qrc diff --git a/CMakeLists.txt b/CMakeLists.txt index 771bc95b2..2434c784d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,7 @@ endif() # WIN32_EXECUTABLE TRUE #) -file(COPY fonts DESTINATION ${CMAKE_BINARY_DIR}) +#file(COPY fonts DESTINATION ${CMAKE_BINARY_DIR}) if(QT_VERSION_MAJOR EQUAL 6) # qt_finalize_executable(QtMaterialWidgets) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 29c85a749..dcb40f459 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -147,6 +147,8 @@ set(PROJECT_SOURCES list_p.h listitem.h listitem_p.h + # resources + resources.qrc ) if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) @@ -183,8 +185,6 @@ set_target_properties(components PROPERTIES WIN32_EXECUTABLE TRUE ) -file(COPY icons DESTINATION ${CMAKE_BINARY_DIR}/components) - if(QT_VERSION_MAJOR EQUAL 6) # qt_finalize_executable(components) endif() diff --git a/components/lib/checkable.cpp b/components/lib/checkable.cpp index e160afd6d..2c778850f 100644 --- a/components/lib/checkable.cpp +++ b/components/lib/checkable.cpp @@ -26,8 +26,8 @@ void CheckablePrivate::init() Q_Q(Checkable); rippleOverlay = new RippleOverlay; - checkedIcon = new CheckableIcon(QIcon(QDir::currentPath()+"/../components/icons/toggle/svg/production/ic_check_box_24px.svg"), q); - uncheckedIcon = new CheckableIcon(QIcon(QDir::currentPath()+"/../components/icons/toggle/svg/production/ic_check_box_outline_blank_24px.svg"), q); + checkedIcon = new CheckableIcon(QIcon(":/icons/icons/toggle/svg/production/ic_check_box_24px.svg"), q); + uncheckedIcon = new CheckableIcon(QIcon(":/icons/icons/toggle/svg/production/ic_check_box_outline_blank_24px.svg"), q); stateMachine = new QStateMachine(q); uncheckedState = new QState; checkedState = new QState; diff --git a/components/lib/checkable_p.h b/components/lib/checkable_p.h index 2fb61fd5e..5c8854774 100644 --- a/components/lib/checkable_p.h +++ b/components/lib/checkable_p.h @@ -9,7 +9,6 @@ #include #include #include -#include #include "lib/checkable.h" diff --git a/components/lib/style.cpp b/components/lib/style.cpp index e3838bdda..3a817154b 100644 --- a/components/lib/style.cpp +++ b/components/lib/style.cpp @@ -21,9 +21,9 @@ void StylePrivate::init() { Q_Q(Style); - QFontDatabase::addApplicationFont(QDir::currentPath()+"/../fonts/roboto_regular"); - QFontDatabase::addApplicationFont(QDir::currentPath()+"/../fonts/roboto_medium"); - QFontDatabase::addApplicationFont(QDir::currentPath()+"/../fonts/roboto_bold"); + QFontDatabase::addApplicationFont(":/fonts/fonts/roboto_regular"); + QFontDatabase::addApplicationFont(":/fonts/fonts/roboto_medium"); + QFontDatabase::addApplicationFont(":/fonts/fonts/roboto_bold"); q->setTheme(new Theme); } diff --git a/components/lib/style_p.h b/components/lib/style_p.h index f262d5912..8e93f973c 100644 --- a/components/lib/style_p.h +++ b/components/lib/style_p.h @@ -3,7 +3,6 @@ #include #include -#include namespace md { diff --git a/components/lib/theme.cpp b/components/lib/theme.cpp index ea1e1a0bf..e481774cc 100644 --- a/components/lib/theme.cpp +++ b/components/lib/theme.cpp @@ -154,7 +154,7 @@ void Theme::setColor(const QString &key, Material::Color color) QIcon Theme::icon(QString category, QString icon) { - return QIcon(QDir::currentPath() % "/../components/icons/" % category % "/svg/production/ic_" % icon % "_24px.svg"); + return QIcon(":/icons/icons/" % category % "/svg/production/ic_" % icon % "_24px.svg"); } } diff --git a/components/lib/theme_p.h b/components/lib/theme_p.h index 43e45661a..cdaf8e986 100644 --- a/components/lib/theme_p.h +++ b/components/lib/theme_p.h @@ -5,7 +5,6 @@ #include #include #include -#include #include namespace md diff --git a/components/resources.qrc b/components/resources.qrc new file mode 100644 index 000000000..1ff57241a --- /dev/null +++ b/components/resources.qrc @@ -0,0 +1,978 @@ + + + fonts/Roboto/Roboto-Black.ttf + fonts/Roboto/Roboto-BlackItalic.ttf + fonts/Roboto/Roboto-Bold.ttf + fonts/Roboto/Roboto-BoldItalic.ttf + fonts/Roboto/Roboto-Italic.ttf + fonts/Roboto/Roboto-Light.ttf + fonts/Roboto/Roboto-LightItalic.ttf + fonts/Roboto/Roboto-Medium.ttf + fonts/Roboto/Roboto-MediumItalic.ttf + fonts/Roboto/Roboto-Regular.ttf + fonts/Roboto/Roboto-Thin.ttf + fonts/Roboto/Roboto-ThinItalic.ttf + + + icons/communication/svg/production/ic_message_24px.svg + icons/toggle/svg/production/ic_check_box_24px.svg + icons/toggle/svg/production/ic_check_box_outline_blank_24px.svg + icons/toggle/svg/production/ic_indeterminate_check_box_24px.svg + icons/toggle/svg/production/ic_radio_button_checked_24px.svg + icons/toggle/svg/production/ic_radio_button_unchecked_24px.svg + icons/toggle/svg/production/ic_star_24px.svg + icons/toggle/svg/production/ic_star_border_24px.svg + icons/toggle/svg/production/ic_star_half_24px.svg + icons/communication/svg/production/ic_business_24px.svg + icons/communication/svg/production/ic_call_24px.svg + icons/communication/svg/production/ic_call_end_24px.svg + icons/communication/svg/production/ic_call_made_24px.svg + icons/communication/svg/production/ic_call_merge_24px.svg + icons/communication/svg/production/ic_call_missed_24px.svg + icons/communication/svg/production/ic_call_missed_outgoing_24px.svg + icons/communication/svg/production/ic_call_received_24px.svg + icons/communication/svg/production/ic_call_split_24px.svg + icons/communication/svg/production/ic_chat_24px.svg + icons/communication/svg/production/ic_chat_bubble_24px.svg + icons/communication/svg/production/ic_chat_bubble_outline_24px.svg + icons/communication/svg/production/ic_clear_all_24px.svg + icons/communication/svg/production/ic_comment_24px.svg + icons/communication/svg/production/ic_contact_mail_24px.svg + icons/communication/svg/production/ic_contact_phone_24px.svg + icons/communication/svg/production/ic_contacts_24px.svg + icons/communication/svg/production/ic_dialer_sip_24px.svg + icons/communication/svg/production/ic_dialpad_24px.svg + icons/communication/svg/production/ic_email_24px.svg + icons/communication/svg/production/ic_forum_24px.svg + icons/communication/svg/production/ic_import_contacts_24px.svg + icons/communication/svg/production/ic_import_export_24px.svg + icons/communication/svg/production/ic_invert_colors_off_24px.svg + icons/communication/svg/production/ic_live_help_24px.svg + icons/communication/svg/production/ic_location_off_24px.svg + icons/communication/svg/production/ic_location_on_24px.svg + icons/communication/svg/production/ic_mail_outline_24px.svg + icons/communication/svg/production/ic_no_sim_24px.svg + icons/communication/svg/production/ic_phone_24px.svg + icons/communication/svg/production/ic_phonelink_erase_24px.svg + icons/communication/svg/production/ic_phonelink_lock_24px.svg + icons/communication/svg/production/ic_phonelink_ring_24px.svg + icons/communication/svg/production/ic_phonelink_setup_24px.svg + icons/communication/svg/production/ic_portable_wifi_off_24px.svg + icons/communication/svg/production/ic_present_to_all_24px.svg + icons/communication/svg/production/ic_ring_volume_24px.svg + icons/communication/svg/production/ic_rss_feed_24px.svg + icons/communication/svg/production/ic_screen_share_24px.svg + icons/communication/svg/production/ic_speaker_phone_24px.svg + icons/communication/svg/production/ic_stay_current_landscape_24px.svg + icons/communication/svg/production/ic_stay_current_portrait_24px.svg + icons/communication/svg/production/ic_stay_primary_landscape_24px.svg + icons/communication/svg/production/ic_stay_primary_portrait_24px.svg + icons/communication/svg/production/ic_stop_screen_share_24px.svg + icons/communication/svg/production/ic_swap_calls_24px.svg + icons/communication/svg/production/ic_textsms_24px.svg + icons/communication/svg/production/ic_voicemail_24px.svg + icons/communication/svg/production/ic_vpn_key_24px.svg + icons/action/svg/production/ic_3d_rotation_24px.svg + icons/action/svg/production/ic_accessibility_24px.svg + icons/action/svg/production/ic_accessible_24px.svg + icons/action/svg/production/ic_account_balance_24px.svg + icons/action/svg/production/ic_account_balance_wallet_24px.svg + icons/action/svg/production/ic_account_box_24px.svg + icons/action/svg/production/ic_account_circle_24px.svg + icons/action/svg/production/ic_add_shopping_cart_24px.svg + icons/action/svg/production/ic_alarm_24px.svg + icons/action/svg/production/ic_alarm_add_24px.svg + icons/action/svg/production/ic_alarm_off_24px.svg + icons/action/svg/production/ic_alarm_on_24px.svg + icons/action/svg/production/ic_all_out_24px.svg + icons/action/svg/production/ic_android_24px.svg + icons/action/svg/production/ic_announcement_24px.svg + icons/action/svg/production/ic_aspect_ratio_24px.svg + icons/action/svg/production/ic_assessment_24px.svg + icons/action/svg/production/ic_assignment_24px.svg + icons/action/svg/production/ic_assignment_ind_24px.svg + icons/action/svg/production/ic_assignment_late_24px.svg + icons/action/svg/production/ic_assignment_return_24px.svg + icons/action/svg/production/ic_assignment_returned_24px.svg + icons/action/svg/production/ic_assignment_turned_in_24px.svg + icons/action/svg/production/ic_autorenew_24px.svg + icons/action/svg/production/ic_backup_24px.svg + icons/action/svg/production/ic_book_24px.svg + icons/action/svg/production/ic_bookmark_24px.svg + icons/action/svg/production/ic_bookmark_border_24px.svg + icons/action/svg/production/ic_bug_report_24px.svg + icons/action/svg/production/ic_build_24px.svg + icons/action/svg/production/ic_cached_24px.svg + icons/action/svg/production/ic_camera_enhance_24px.svg + icons/action/svg/production/ic_card_giftcard_24px.svg + icons/action/svg/production/ic_card_membership_24px.svg + icons/action/svg/production/ic_card_travel_24px.svg + icons/action/svg/production/ic_change_history_24px.svg + icons/action/svg/production/ic_check_circle_24px.svg + icons/action/svg/production/ic_chrome_reader_mode_24px.svg + icons/action/svg/production/ic_class_24px.svg + icons/action/svg/production/ic_code_24px.svg + icons/action/svg/production/ic_compare_arrows_24px.svg + icons/action/svg/production/ic_copyright_24px.svg + icons/action/svg/production/ic_credit_card_24px.svg + icons/action/svg/production/ic_dashboard_24px.svg + icons/action/svg/production/ic_date_range_24px.svg + icons/action/svg/production/ic_delete_24px.svg + icons/action/svg/production/ic_delete_forever_24px.svg + icons/action/svg/production/ic_description_24px.svg + icons/action/svg/production/ic_dns_24px.svg + icons/action/svg/production/ic_done_24px.svg + icons/action/svg/production/ic_done_all_24px.svg + icons/action/svg/production/ic_donut_large_24px.svg + icons/action/svg/production/ic_donut_small_24px.svg + icons/action/svg/production/ic_eject_24px.svg + icons/action/svg/production/ic_euro_symbol_24px.svg + icons/action/svg/production/ic_event_24px.svg + icons/action/svg/production/ic_event_seat_24px.svg + icons/action/svg/production/ic_exit_to_app_24px.svg + icons/action/svg/production/ic_explore_24px.svg + icons/action/svg/production/ic_extension_24px.svg + icons/action/svg/production/ic_face_24px.svg + icons/action/svg/production/ic_favorite_24px.svg + icons/action/svg/production/ic_favorite_border_24px.svg + icons/action/svg/production/ic_feedback_24px.svg + icons/action/svg/production/ic_find_in_page_24px.svg + icons/action/svg/production/ic_find_replace_24px.svg + icons/action/svg/production/ic_fingerprint_24px.svg + icons/action/svg/production/ic_flight_land_24px.svg + icons/action/svg/production/ic_flight_takeoff_24px.svg + icons/action/svg/production/ic_flip_to_back_24px.svg + icons/action/svg/production/ic_flip_to_front_24px.svg + icons/action/svg/production/ic_g_translate_24px.svg + icons/action/svg/production/ic_gavel_24px.svg + icons/action/svg/production/ic_get_app_24px.svg + icons/action/svg/production/ic_gif_24px.svg + icons/action/svg/production/ic_grade_24px.svg + icons/action/svg/production/ic_group_work_24px.svg + icons/action/svg/production/ic_help_24px.svg + icons/action/svg/production/ic_help_outline_24px.svg + icons/action/svg/production/ic_highlight_off_24px.svg + icons/action/svg/production/ic_history_24px.svg + icons/action/svg/production/ic_home_24px.svg + icons/action/svg/production/ic_hourglass_empty_24px.svg + icons/action/svg/production/ic_hourglass_full_24px.svg + icons/action/svg/production/ic_http_24px.svg + icons/action/svg/production/ic_https_24px.svg + icons/action/svg/production/ic_important_devices_24px.svg + icons/action/svg/production/ic_info_24px.svg + icons/action/svg/production/ic_info_outline_24px.svg + icons/action/svg/production/ic_input_24px.svg + icons/action/svg/production/ic_invert_colors_24px.svg + icons/action/svg/production/ic_label_24px.svg + icons/action/svg/production/ic_label_outline_24px.svg + icons/action/svg/production/ic_language_24px.svg + icons/action/svg/production/ic_launch_24px.svg + icons/action/svg/production/ic_lightbulb_outline_24px.svg + icons/action/svg/production/ic_line_style_24px.svg + icons/action/svg/production/ic_line_weight_24px.svg + icons/action/svg/production/ic_list_24px.svg + icons/action/svg/production/ic_lock_24px.svg + icons/action/svg/production/ic_lock_open_24px.svg + icons/action/svg/production/ic_lock_outline_24px.svg + icons/action/svg/production/ic_loyalty_24px.svg + icons/action/svg/production/ic_markunread_mailbox_24px.svg + icons/action/svg/production/ic_motorcycle_24px.svg + icons/action/svg/production/ic_note_add_24px.svg + icons/action/svg/production/ic_offline_pin_24px.svg + icons/action/svg/production/ic_opacity_24px.svg + icons/action/svg/production/ic_open_in_browser_24px.svg + icons/action/svg/production/ic_open_in_new_24px.svg + icons/action/svg/production/ic_open_with_24px.svg + icons/action/svg/production/ic_pageview_24px.svg + icons/action/svg/production/ic_pan_tool_24px.svg + icons/action/svg/production/ic_payment_24px.svg + icons/action/svg/production/ic_perm_camera_mic_24px.svg + icons/action/svg/production/ic_perm_contact_calendar_24px.svg + icons/action/svg/production/ic_perm_data_setting_24px.svg + icons/action/svg/production/ic_perm_device_information_24px.svg + icons/action/svg/production/ic_perm_identity_24px.svg + icons/action/svg/production/ic_perm_media_24px.svg + icons/action/svg/production/ic_perm_phone_msg_24px.svg + icons/action/svg/production/ic_perm_scan_wifi_24px.svg + icons/action/svg/production/ic_pets_24px.svg + icons/action/svg/production/ic_picture_in_picture_24px.svg + icons/action/svg/production/ic_picture_in_picture_alt_24px.svg + icons/action/svg/production/ic_play_for_work_24px.svg + icons/action/svg/production/ic_polymer_24px.svg + icons/action/svg/production/ic_power_settings_new_24px.svg + icons/action/svg/production/ic_pregnant_woman_24px.svg + icons/action/svg/production/ic_print_24px.svg + icons/action/svg/production/ic_query_builder_24px.svg + icons/action/svg/production/ic_question_answer_24px.svg + icons/action/svg/production/ic_receipt_24px.svg + icons/action/svg/production/ic_record_voice_over_24px.svg + icons/action/svg/production/ic_redeem_24px.svg + icons/action/svg/production/ic_remove_shopping_cart_24px.svg + icons/action/svg/production/ic_reorder_24px.svg + icons/action/svg/production/ic_report_problem_24px.svg + icons/action/svg/production/ic_restore_24px.svg + icons/action/svg/production/ic_restore_page_24px.svg + icons/action/svg/production/ic_room_24px.svg + icons/action/svg/production/ic_rounded_corner_24px.svg + icons/action/svg/production/ic_rowing_24px.svg + icons/action/svg/production/ic_schedule_24px.svg + icons/action/svg/production/ic_search_24px.svg + icons/action/svg/production/ic_settings_24px.svg + icons/action/svg/production/ic_settings_applications_24px.svg + icons/action/svg/production/ic_settings_backup_restore_24px.svg + icons/action/svg/production/ic_settings_bluetooth_24px.svg + icons/action/svg/production/ic_settings_brightness_24px.svg + icons/action/svg/production/ic_settings_cell_24px.svg + icons/action/svg/production/ic_settings_ethernet_24px.svg + icons/action/svg/production/ic_settings_input_antenna_24px.svg + icons/action/svg/production/ic_settings_input_component_24px.svg + icons/action/svg/production/ic_settings_input_composite_24px.svg + icons/action/svg/production/ic_settings_input_hdmi_24px.svg + icons/action/svg/production/ic_settings_input_svideo_24px.svg + icons/action/svg/production/ic_settings_overscan_24px.svg + icons/action/svg/production/ic_settings_phone_24px.svg + icons/action/svg/production/ic_settings_power_24px.svg + icons/action/svg/production/ic_settings_remote_24px.svg + icons/action/svg/production/ic_settings_voice_24px.svg + icons/action/svg/production/ic_shop_24px.svg + icons/action/svg/production/ic_shop_two_24px.svg + icons/action/svg/production/ic_shopping_basket_24px.svg + icons/action/svg/production/ic_shopping_cart_24px.svg + icons/action/svg/production/ic_speaker_notes_24px.svg + icons/action/svg/production/ic_speaker_notes_off_24px.svg + icons/action/svg/production/ic_spellcheck_24px.svg + icons/action/svg/production/ic_stars_24px.svg + icons/action/svg/production/ic_store_24px.svg + icons/action/svg/production/ic_subject_24px.svg + icons/action/svg/production/ic_supervisor_account_24px.svg + icons/action/svg/production/ic_swap_horiz_24px.svg + icons/action/svg/production/ic_swap_vert_24px.svg + icons/action/svg/production/ic_swap_vertical_circle_24px.svg + icons/action/svg/production/ic_system_update_alt_24px.svg + icons/action/svg/production/ic_tab_24px.svg + icons/action/svg/production/ic_tab_unselected_24px.svg + icons/action/svg/production/ic_theaters_24px.svg + icons/action/svg/production/ic_thumb_down_24px.svg + icons/action/svg/production/ic_thumb_up_24px.svg + icons/action/svg/production/ic_thumbs_up_down_24px.svg + icons/action/svg/production/ic_timeline_24px.svg + icons/action/svg/production/ic_toc_24px.svg + icons/action/svg/production/ic_today_24px.svg + icons/action/svg/production/ic_toll_24px.svg + icons/action/svg/production/ic_touch_app_24px.svg + icons/action/svg/production/ic_track_changes_24px.svg + icons/action/svg/production/ic_translate_24px.svg + icons/action/svg/production/ic_trending_down_24px.svg + icons/action/svg/production/ic_trending_flat_24px.svg + icons/action/svg/production/ic_trending_up_24px.svg + icons/action/svg/production/ic_turned_in_24px.svg + icons/action/svg/production/ic_turned_in_not_24px.svg + icons/action/svg/production/ic_update_24px.svg + icons/action/svg/production/ic_verified_user_24px.svg + icons/action/svg/production/ic_view_agenda_24px.svg + icons/action/svg/production/ic_view_array_24px.svg + icons/action/svg/production/ic_view_carousel_24px.svg + icons/action/svg/production/ic_view_column_24px.svg + icons/action/svg/production/ic_view_day_24px.svg + icons/action/svg/production/ic_view_headline_24px.svg + icons/action/svg/production/ic_view_list_24px.svg + icons/action/svg/production/ic_view_module_24px.svg + icons/action/svg/production/ic_view_quilt_24px.svg + icons/action/svg/production/ic_view_stream_24px.svg + icons/action/svg/production/ic_view_week_24px.svg + icons/action/svg/production/ic_visibility_24px.svg + icons/action/svg/production/ic_visibility_off_24px.svg + icons/action/svg/production/ic_watch_later_24px.svg + icons/action/svg/production/ic_work_24px.svg + icons/action/svg/production/ic_youtube_searched_for_24px.svg + icons/action/svg/production/ic_zoom_in_24px.svg + icons/action/svg/production/ic_zoom_out_24px.svg + icons/alert/svg/production/ic_add_alert_24px.svg + icons/alert/svg/production/ic_error_24px.svg + icons/alert/svg/production/ic_error_outline_24px.svg + icons/alert/svg/production/ic_warning_24px.svg + icons/av/svg/production/ic_add_to_queue_24px.svg + icons/av/svg/production/ic_airplay_24px.svg + icons/av/svg/production/ic_album_24px.svg + icons/av/svg/production/ic_art_track_24px.svg + icons/av/svg/production/ic_av_timer_24px.svg + icons/av/svg/production/ic_branding_watermark_24px.svg + icons/av/svg/production/ic_call_to_action_24px.svg + icons/av/svg/production/ic_closed_caption_24px.svg + icons/av/svg/production/ic_equalizer_24px.svg + icons/av/svg/production/ic_explicit_24px.svg + icons/av/svg/production/ic_fast_forward_24px.svg + icons/av/svg/production/ic_fast_rewind_24px.svg + icons/av/svg/production/ic_featured_play_list_24px.svg + icons/av/svg/production/ic_featured_video_24px.svg + icons/av/svg/production/ic_fiber_dvr_24px.svg + icons/av/svg/production/ic_fiber_manual_record_24px.svg + icons/av/svg/production/ic_fiber_new_24px.svg + icons/av/svg/production/ic_fiber_pin_24px.svg + icons/av/svg/production/ic_fiber_smart_record_24px.svg + icons/av/svg/production/ic_forward_5_24px.svg + icons/av/svg/production/ic_forward_10_24px.svg + icons/av/svg/production/ic_forward_30_24px.svg + icons/av/svg/production/ic_games_24px.svg + icons/av/svg/production/ic_hd_24px.svg + icons/av/svg/production/ic_hearing_24px.svg + icons/av/svg/production/ic_high_quality_24px.svg + icons/av/svg/production/ic_library_add_24px.svg + icons/av/svg/production/ic_library_books_24px.svg + icons/av/svg/production/ic_library_music_24px.svg + icons/av/svg/production/ic_loop_24px.svg + icons/av/svg/production/ic_mic_24px.svg + icons/av/svg/production/ic_mic_none_24px.svg + icons/av/svg/production/ic_mic_off_24px.svg + icons/av/svg/production/ic_movie_24px.svg + icons/av/svg/production/ic_music_video_24px.svg + icons/av/svg/production/ic_new_releases_24px.svg + icons/av/svg/production/ic_not_interested_24px.svg + icons/av/svg/production/ic_note_24px.svg + icons/av/svg/production/ic_pause_24px.svg + icons/av/svg/production/ic_pause_circle_filled_24px.svg + icons/av/svg/production/ic_pause_circle_outline_24px.svg + icons/av/svg/production/ic_play_arrow_24px.svg + icons/av/svg/production/ic_play_circle_filled_24px.svg + icons/av/svg/production/ic_play_circle_outline_24px.svg + icons/av/svg/production/ic_playlist_add_24px.svg + icons/av/svg/production/ic_playlist_add_check_24px.svg + icons/av/svg/production/ic_playlist_play_24px.svg + icons/av/svg/production/ic_queue_24px.svg + icons/av/svg/production/ic_queue_music_24px.svg + icons/av/svg/production/ic_queue_play_next_24px.svg + icons/av/svg/production/ic_radio_24px.svg + icons/av/svg/production/ic_recent_actors_24px.svg + icons/av/svg/production/ic_remove_from_queue_24px.svg + icons/av/svg/production/ic_repeat_24px.svg + icons/av/svg/production/ic_repeat_one_24px.svg + icons/av/svg/production/ic_replay_5_24px.svg + icons/av/svg/production/ic_replay_10_24px.svg + icons/av/svg/production/ic_replay_24px.svg + icons/av/svg/production/ic_replay_30_24px.svg + icons/av/svg/production/ic_shuffle_24px.svg + icons/av/svg/production/ic_skip_next_24px.svg + icons/av/svg/production/ic_skip_previous_24px.svg + icons/av/svg/production/ic_slow_motion_video_24px.svg + icons/av/svg/production/ic_snooze_24px.svg + icons/av/svg/production/ic_sort_by_alpha_24px.svg + icons/av/svg/production/ic_stop_24px.svg + icons/av/svg/production/ic_subscriptions_24px.svg + icons/av/svg/production/ic_subtitles_24px.svg + icons/av/svg/production/ic_surround_sound_24px.svg + icons/av/svg/production/ic_video_call_24px.svg + icons/av/svg/production/ic_video_label_24px.svg + icons/av/svg/production/ic_video_library_24px.svg + icons/av/svg/production/ic_videocam_24px.svg + icons/av/svg/production/ic_videocam_off_24px.svg + icons/av/svg/production/ic_volume_down_24px.svg + icons/av/svg/production/ic_volume_mute_24px.svg + icons/av/svg/production/ic_volume_off_24px.svg + icons/av/svg/production/ic_volume_up_24px.svg + icons/av/svg/production/ic_web_24px.svg + icons/av/svg/production/ic_web_asset_24px.svg + icons/content/svg/production/ic_add_24px.svg + icons/content/svg/production/ic_add_box_24px.svg + icons/content/svg/production/ic_add_circle_24px.svg + icons/content/svg/production/ic_add_circle_outline_24px.svg + icons/content/svg/production/ic_archive_24px.svg + icons/content/svg/production/ic_backspace_24px.svg + icons/content/svg/production/ic_block_24px.svg + icons/content/svg/production/ic_clear_24px.svg + icons/content/svg/production/ic_content_copy_24px.svg + icons/content/svg/production/ic_content_cut_24px.svg + icons/content/svg/production/ic_content_paste_24px.svg + icons/content/svg/production/ic_create_24px.svg + icons/content/svg/production/ic_delete_sweep_24px.svg + icons/content/svg/production/ic_drafts_24px.svg + icons/content/svg/production/ic_filter_list_24px.svg + icons/content/svg/production/ic_flag_24px.svg + icons/content/svg/production/ic_font_download_24px.svg + icons/content/svg/production/ic_forward_24px.svg + icons/content/svg/production/ic_gesture_24px.svg + icons/content/svg/production/ic_inbox_24px.svg + icons/content/svg/production/ic_link_24px.svg + icons/content/svg/production/ic_low_priority_24px.svg + icons/content/svg/production/ic_mail_24px.svg + icons/content/svg/production/ic_markunread_24px.svg + icons/content/svg/production/ic_move_to_inbox_24px.svg + icons/content/svg/production/ic_next_week_24px.svg + icons/content/svg/production/ic_redo_24px.svg + icons/content/svg/production/ic_remove_24px.svg + icons/content/svg/production/ic_remove_circle_24px.svg + icons/content/svg/production/ic_remove_circle_outline_24px.svg + icons/content/svg/production/ic_reply_24px.svg + icons/content/svg/production/ic_reply_all_24px.svg + icons/content/svg/production/ic_report_24px.svg + icons/content/svg/production/ic_save_24px.svg + icons/content/svg/production/ic_select_all_24px.svg + icons/content/svg/production/ic_send_24px.svg + icons/content/svg/production/ic_sort_24px.svg + icons/content/svg/production/ic_text_format_24px.svg + icons/content/svg/production/ic_unarchive_24px.svg + icons/content/svg/production/ic_undo_24px.svg + icons/content/svg/production/ic_weekend_24px.svg + icons/device/svg/production/ic_access_alarm_24px.svg + icons/device/svg/production/ic_access_alarms_24px.svg + icons/device/svg/production/ic_access_time_24px.svg + icons/device/svg/production/ic_add_alarm_24px.svg + icons/device/svg/production/ic_airplanemode_active_24px.svg + icons/device/svg/production/ic_airplanemode_inactive_24px.svg + icons/device/svg/production/ic_battery_20_24px.svg + icons/device/svg/production/ic_battery_30_24px.svg + icons/device/svg/production/ic_battery_50_24px.svg + icons/device/svg/production/ic_battery_60_24px.svg + icons/device/svg/production/ic_battery_80_24px.svg + icons/device/svg/production/ic_battery_90_24px.svg + icons/device/svg/production/ic_battery_alert_24px.svg + icons/device/svg/production/ic_battery_charging_20_24px.svg + icons/device/svg/production/ic_battery_charging_30_24px.svg + icons/device/svg/production/ic_battery_charging_50_24px.svg + icons/device/svg/production/ic_battery_charging_60_24px.svg + icons/device/svg/production/ic_battery_charging_80_24px.svg + icons/device/svg/production/ic_battery_charging_90_24px.svg + icons/device/svg/production/ic_battery_charging_full_24px.svg + icons/device/svg/production/ic_battery_full_24px.svg + icons/device/svg/production/ic_battery_std_24px.svg + icons/device/svg/production/ic_battery_unknown_24px.svg + icons/device/svg/production/ic_bluetooth_24px.svg + icons/device/svg/production/ic_bluetooth_connected_24px.svg + icons/device/svg/production/ic_bluetooth_disabled_24px.svg + icons/device/svg/production/ic_bluetooth_searching_24px.svg + icons/device/svg/production/ic_brightness_auto_24px.svg + icons/device/svg/production/ic_brightness_high_24px.svg + icons/device/svg/production/ic_brightness_low_24px.svg + icons/device/svg/production/ic_brightness_medium_24px.svg + icons/device/svg/production/ic_data_usage_24px.svg + icons/device/svg/production/ic_developer_mode_24px.svg + icons/device/svg/production/ic_devices_24px.svg + icons/device/svg/production/ic_dvr_24px.svg + icons/device/svg/production/ic_gps_fixed_24px.svg + icons/device/svg/production/ic_gps_not_fixed_24px.svg + icons/device/svg/production/ic_gps_off_24px.svg + icons/device/svg/production/ic_graphic_eq_24px.svg + icons/device/svg/production/ic_location_disabled_24px.svg + icons/device/svg/production/ic_location_searching_24px.svg + icons/device/svg/production/ic_network_cell_24px.svg + icons/device/svg/production/ic_network_wifi_24px.svg + icons/device/svg/production/ic_nfc_24px.svg + icons/device/svg/production/ic_screen_lock_landscape_24px.svg + icons/device/svg/production/ic_screen_lock_portrait_24px.svg + icons/device/svg/production/ic_screen_lock_rotation_24px.svg + icons/device/svg/production/ic_screen_rotation_24px.svg + icons/device/svg/production/ic_sd_storage_24px.svg + icons/device/svg/production/ic_settings_system_daydream_24px.svg + icons/device/svg/production/ic_signal_cellular_0_bar_24px.svg + icons/device/svg/production/ic_signal_cellular_1_bar_24px.svg + icons/device/svg/production/ic_signal_cellular_2_bar_24px.svg + icons/device/svg/production/ic_signal_cellular_3_bar_24px.svg + icons/device/svg/production/ic_signal_cellular_4_bar_24px.svg + icons/device/svg/production/ic_signal_cellular_connected_no_internet_0_bar_24px.svg + icons/device/svg/production/ic_signal_cellular_connected_no_internet_1_bar_24px.svg + icons/device/svg/production/ic_signal_cellular_connected_no_internet_2_bar_24px.svg + icons/device/svg/production/ic_signal_cellular_connected_no_internet_3_bar_24px.svg + icons/device/svg/production/ic_signal_cellular_connected_no_internet_4_bar_24px.svg + icons/device/svg/production/ic_signal_cellular_no_sim_24px.svg + icons/device/svg/production/ic_signal_cellular_null_24px.svg + icons/device/svg/production/ic_signal_cellular_off_24px.svg + icons/device/svg/production/ic_signal_wifi_0_bar_24px.svg + icons/device/svg/production/ic_signal_wifi_1_bar_24px.svg + icons/device/svg/production/ic_signal_wifi_1_bar_lock_24px.svg + icons/device/svg/production/ic_signal_wifi_2_bar_24px.svg + icons/device/svg/production/ic_signal_wifi_2_bar_lock_24px.svg + icons/device/svg/production/ic_signal_wifi_3_bar_24px.svg + icons/device/svg/production/ic_signal_wifi_3_bar_lock_24px.svg + icons/device/svg/production/ic_signal_wifi_4_bar_24px.svg + icons/device/svg/production/ic_signal_wifi_4_bar_lock_24px.svg + icons/device/svg/production/ic_signal_wifi_off_24px.svg + icons/device/svg/production/ic_storage_24px.svg + icons/device/svg/production/ic_usb_24px.svg + icons/device/svg/production/ic_wallpaper_24px.svg + icons/device/svg/production/ic_widgets_24px.svg + icons/device/svg/production/ic_wifi_lock_24px.svg + icons/device/svg/production/ic_wifi_tethering_24px.svg + icons/editor/svg/production/ic_attach_file_24px.svg + icons/editor/svg/production/ic_attach_money_24px.svg + icons/editor/svg/production/ic_border_all_24px.svg + icons/editor/svg/production/ic_border_bottom_24px.svg + icons/editor/svg/production/ic_border_clear_24px.svg + icons/editor/svg/production/ic_border_color_24px.svg + icons/editor/svg/production/ic_border_horizontal_24px.svg + icons/editor/svg/production/ic_border_inner_24px.svg + icons/editor/svg/production/ic_border_left_24px.svg + icons/editor/svg/production/ic_border_outer_24px.svg + icons/editor/svg/production/ic_border_right_24px.svg + icons/editor/svg/production/ic_border_style_24px.svg + icons/editor/svg/production/ic_border_top_24px.svg + icons/editor/svg/production/ic_border_vertical_24px.svg + icons/editor/svg/production/ic_bubble_chart_24px.svg + icons/editor/svg/production/ic_drag_handle_24px.svg + icons/editor/svg/production/ic_format_align_center_24px.svg + icons/editor/svg/production/ic_format_align_justify_24px.svg + icons/editor/svg/production/ic_format_align_left_24px.svg + icons/editor/svg/production/ic_format_align_right_24px.svg + icons/editor/svg/production/ic_format_bold_24px.svg + icons/editor/svg/production/ic_format_clear_24px.svg + icons/editor/svg/production/ic_format_color_fill_24px.svg + icons/editor/svg/production/ic_format_color_reset_24px.svg + icons/editor/svg/production/ic_format_color_text_24px.svg + icons/editor/svg/production/ic_format_indent_decrease_24px.svg + icons/editor/svg/production/ic_format_indent_increase_24px.svg + icons/editor/svg/production/ic_format_italic_24px.svg + icons/editor/svg/production/ic_format_line_spacing_24px.svg + icons/editor/svg/production/ic_format_list_bulleted_24px.svg + icons/editor/svg/production/ic_format_list_numbered_24px.svg + icons/editor/svg/production/ic_format_paint_24px.svg + icons/editor/svg/production/ic_format_quote_24px.svg + icons/editor/svg/production/ic_format_shapes_24px.svg + icons/editor/svg/production/ic_format_size_24px.svg + icons/editor/svg/production/ic_format_strikethrough_24px.svg + icons/editor/svg/production/ic_format_textdirection_l_to_r_24px.svg + icons/editor/svg/production/ic_format_textdirection_r_to_l_24px.svg + icons/editor/svg/production/ic_format_underlined_24px.svg + icons/editor/svg/production/ic_functions_24px.svg + icons/editor/svg/production/ic_highlight_24px.svg + icons/editor/svg/production/ic_insert_chart_24px.svg + icons/editor/svg/production/ic_insert_comment_24px.svg + icons/editor/svg/production/ic_insert_drive_file_24px.svg + icons/editor/svg/production/ic_insert_emoticon_24px.svg + icons/editor/svg/production/ic_insert_invitation_24px.svg + icons/editor/svg/production/ic_insert_link_24px.svg + icons/editor/svg/production/ic_insert_photo_24px.svg + icons/editor/svg/production/ic_linear_scale_24px.svg + icons/editor/svg/production/ic_merge_type_24px.svg + icons/editor/svg/production/ic_mode_comment_24px.svg + icons/editor/svg/production/ic_mode_edit_24px.svg + icons/editor/svg/production/ic_monetization_on_24px.svg + icons/editor/svg/production/ic_money_off_24px.svg + icons/editor/svg/production/ic_multiline_chart_24px.svg + icons/editor/svg/production/ic_pie_chart_24px.svg + icons/editor/svg/production/ic_pie_chart_outlined_24px.svg + icons/editor/svg/production/ic_publish_24px.svg + icons/editor/svg/production/ic_short_text_24px.svg + icons/editor/svg/production/ic_show_chart_24px.svg + icons/editor/svg/production/ic_space_bar_24px.svg + icons/editor/svg/production/ic_strikethrough_s_24px.svg + icons/editor/svg/production/ic_text_fields_24px.svg + icons/editor/svg/production/ic_title_24px.svg + icons/editor/svg/production/ic_vertical_align_bottom_24px.svg + icons/editor/svg/production/ic_vertical_align_center_24px.svg + icons/editor/svg/production/ic_vertical_align_top_24px.svg + icons/editor/svg/production/ic_wrap_text_24px.svg + icons/file/svg/production/ic_attachment_24px.svg + icons/file/svg/production/ic_cloud_24px.svg + icons/file/svg/production/ic_cloud_circle_24px.svg + icons/file/svg/production/ic_cloud_done_24px.svg + icons/file/svg/production/ic_cloud_download_24px.svg + icons/file/svg/production/ic_cloud_off_24px.svg + icons/file/svg/production/ic_cloud_queue_24px.svg + icons/file/svg/production/ic_cloud_upload_24px.svg + icons/file/svg/production/ic_create_new_folder_24px.svg + icons/file/svg/production/ic_file_download_24px.svg + icons/file/svg/production/ic_file_upload_24px.svg + icons/file/svg/production/ic_folder_24px.svg + icons/file/svg/production/ic_folder_open_24px.svg + icons/file/svg/production/ic_folder_shared_24px.svg + icons/hardware/svg/production/ic_cast_24px.svg + icons/hardware/svg/production/ic_cast_connected_24px.svg + icons/hardware/svg/production/ic_computer_24px.svg + icons/hardware/svg/production/ic_desktop_mac_24px.svg + icons/hardware/svg/production/ic_desktop_windows_24px.svg + icons/hardware/svg/production/ic_developer_board_24px.svg + icons/hardware/svg/production/ic_device_hub_24px.svg + icons/hardware/svg/production/ic_devices_other_24px.svg + icons/hardware/svg/production/ic_dock_24px.svg + icons/hardware/svg/production/ic_gamepad_24px.svg + icons/hardware/svg/production/ic_headset_24px.svg + icons/hardware/svg/production/ic_headset_mic_24px.svg + icons/hardware/svg/production/ic_keyboard_24px.svg + icons/hardware/svg/production/ic_keyboard_arrow_down_24px.svg + icons/hardware/svg/production/ic_keyboard_arrow_left_24px.svg + icons/hardware/svg/production/ic_keyboard_arrow_right_24px.svg + icons/hardware/svg/production/ic_keyboard_arrow_up_24px.svg + icons/hardware/svg/production/ic_keyboard_backspace_24px.svg + icons/hardware/svg/production/ic_keyboard_capslock_24px.svg + icons/hardware/svg/production/ic_keyboard_hide_24px.svg + icons/hardware/svg/production/ic_keyboard_return_24px.svg + icons/hardware/svg/production/ic_keyboard_tab_24px.svg + icons/hardware/svg/production/ic_keyboard_voice_24px.svg + icons/hardware/svg/production/ic_laptop_24px.svg + icons/hardware/svg/production/ic_laptop_chromebook_24px.svg + icons/hardware/svg/production/ic_laptop_mac_24px.svg + icons/hardware/svg/production/ic_laptop_windows_24px.svg + icons/hardware/svg/production/ic_memory_24px.svg + icons/hardware/svg/production/ic_mouse_24px.svg + icons/hardware/svg/production/ic_phone_android_24px.svg + icons/hardware/svg/production/ic_phone_iphone_24px.svg + icons/hardware/svg/production/ic_phonelink_24px.svg + icons/hardware/svg/production/ic_phonelink_off_24px.svg + icons/hardware/svg/production/ic_power_input_24px.svg + icons/hardware/svg/production/ic_router_24px.svg + icons/hardware/svg/production/ic_scanner_24px.svg + icons/hardware/svg/production/ic_security_24px.svg + icons/hardware/svg/production/ic_sim_card_24px.svg + icons/hardware/svg/production/ic_smartphone_24px.svg + icons/hardware/svg/production/ic_speaker_24px.svg + icons/hardware/svg/production/ic_speaker_group_24px.svg + icons/hardware/svg/production/ic_tablet_24px.svg + icons/hardware/svg/production/ic_tablet_android_24px.svg + icons/hardware/svg/production/ic_tablet_mac_24px.svg + icons/hardware/svg/production/ic_toys_24px.svg + icons/hardware/svg/production/ic_tv_24px.svg + icons/hardware/svg/production/ic_videogame_asset_24px.svg + icons/hardware/svg/production/ic_watch_24px.svg + icons/image/svg/production/ic_add_a_photo_24px.svg + icons/image/svg/production/ic_add_to_photos_24px.svg + icons/image/svg/production/ic_adjust_24px.svg + icons/image/svg/production/ic_assistant_24px.svg + icons/image/svg/production/ic_assistant_photo_24px.svg + icons/image/svg/production/ic_audiotrack_24px.svg + icons/image/svg/production/ic_blur_circular_24px.svg + icons/image/svg/production/ic_blur_linear_24px.svg + icons/image/svg/production/ic_blur_off_24px.svg + icons/image/svg/production/ic_blur_on_24px.svg + icons/image/svg/production/ic_brightness_1_24px.svg + icons/image/svg/production/ic_brightness_2_24px.svg + icons/image/svg/production/ic_brightness_3_24px.svg + icons/image/svg/production/ic_brightness_4_24px.svg + icons/image/svg/production/ic_brightness_5_24px.svg + icons/image/svg/production/ic_brightness_6_24px.svg + icons/image/svg/production/ic_brightness_7_24px.svg + icons/image/svg/production/ic_broken_image_24px.svg + icons/image/svg/production/ic_brush_24px.svg + icons/image/svg/production/ic_burst_mode_24px.svg + icons/image/svg/production/ic_camera_24px.svg + icons/image/svg/production/ic_camera_alt_24px.svg + icons/image/svg/production/ic_camera_front_24px.svg + icons/image/svg/production/ic_camera_rear_24px.svg + icons/image/svg/production/ic_camera_roll_24px.svg + icons/image/svg/production/ic_center_focus_strong_24px.svg + icons/image/svg/production/ic_center_focus_weak_24px.svg + icons/image/svg/production/ic_collections_24px.svg + icons/image/svg/production/ic_collections_bookmark_24px.svg + icons/image/svg/production/ic_color_lens_24px.svg + icons/image/svg/production/ic_colorize_24px.svg + icons/image/svg/production/ic_compare_24px.svg + icons/image/svg/production/ic_control_point_24px.svg + icons/image/svg/production/ic_control_point_duplicate_24px.svg + icons/image/svg/production/ic_crop_3_2_24px.svg + icons/image/svg/production/ic_crop_5_4_24px.svg + icons/image/svg/production/ic_crop_7_5_24px.svg + icons/image/svg/production/ic_crop_16_9_24px.svg + icons/image/svg/production/ic_crop_24px.svg + icons/image/svg/production/ic_crop_din_24px.svg + icons/image/svg/production/ic_crop_free_24px.svg + icons/image/svg/production/ic_crop_landscape_24px.svg + icons/image/svg/production/ic_crop_original_24px.svg + icons/image/svg/production/ic_crop_portrait_24px.svg + icons/image/svg/production/ic_crop_rotate_24px.svg + icons/image/svg/production/ic_crop_square_24px.svg + icons/image/svg/production/ic_dehaze_24px.svg + icons/image/svg/production/ic_details_24px.svg + icons/image/svg/production/ic_edit_24px.svg + icons/image/svg/production/ic_exposure_24px.svg + icons/image/svg/production/ic_exposure_neg_1_24px.svg + icons/image/svg/production/ic_exposure_neg_2_24px.svg + icons/image/svg/production/ic_exposure_plus_1_24px.svg + icons/image/svg/production/ic_exposure_plus_2_24px.svg + icons/image/svg/production/ic_exposure_zero_24px.svg + icons/image/svg/production/ic_filter_1_24px.svg + icons/image/svg/production/ic_filter_2_24px.svg + icons/image/svg/production/ic_filter_3_24px.svg + icons/image/svg/production/ic_filter_4_24px.svg + icons/image/svg/production/ic_filter_5_24px.svg + icons/image/svg/production/ic_filter_6_24px.svg + icons/image/svg/production/ic_filter_7_24px.svg + icons/image/svg/production/ic_filter_8_24px.svg + icons/image/svg/production/ic_filter_9_24px.svg + icons/image/svg/production/ic_filter_9_plus_24px.svg + icons/image/svg/production/ic_filter_24px.svg + icons/image/svg/production/ic_filter_b_and_w_24px.svg + icons/image/svg/production/ic_filter_center_focus_24px.svg + icons/image/svg/production/ic_filter_drama_24px.svg + icons/image/svg/production/ic_filter_frames_24px.svg + icons/image/svg/production/ic_filter_hdr_24px.svg + icons/image/svg/production/ic_filter_none_24px.svg + icons/image/svg/production/ic_filter_tilt_shift_24px.svg + icons/image/svg/production/ic_filter_vintage_24px.svg + icons/image/svg/production/ic_flare_24px.svg + icons/image/svg/production/ic_flash_auto_24px.svg + icons/image/svg/production/ic_flash_off_24px.svg + icons/image/svg/production/ic_flash_on_24px.svg + icons/image/svg/production/ic_flip_24px.svg + icons/image/svg/production/ic_gradient_24px.svg + icons/image/svg/production/ic_grain_24px.svg + icons/image/svg/production/ic_grid_off_24px.svg + icons/image/svg/production/ic_grid_on_24px.svg + icons/image/svg/production/ic_hdr_off_24px.svg + icons/image/svg/production/ic_hdr_on_24px.svg + icons/image/svg/production/ic_hdr_strong_24px.svg + icons/image/svg/production/ic_hdr_weak_24px.svg + icons/image/svg/production/ic_healing_24px.svg + icons/image/svg/production/ic_image_24px.svg + icons/image/svg/production/ic_image_aspect_ratio_24px.svg + icons/image/svg/production/ic_iso_24px.svg + icons/image/svg/production/ic_landscape_24px.svg + icons/image/svg/production/ic_leak_add_24px.svg + icons/image/svg/production/ic_leak_remove_24px.svg + icons/image/svg/production/ic_lens_24px.svg + icons/image/svg/production/ic_linked_camera_24px.svg + icons/image/svg/production/ic_looks_3_24px.svg + icons/image/svg/production/ic_looks_4_24px.svg + icons/image/svg/production/ic_looks_5_24px.svg + icons/image/svg/production/ic_looks_6_24px.svg + icons/image/svg/production/ic_looks_24px.svg + icons/image/svg/production/ic_looks_one_24px.svg + icons/image/svg/production/ic_looks_two_24px.svg + icons/image/svg/production/ic_loupe_24px.svg + icons/image/svg/production/ic_monochrome_photos_24px.svg + icons/image/svg/production/ic_movie_creation_24px.svg + icons/image/svg/production/ic_movie_filter_24px.svg + icons/image/svg/production/ic_music_note_24px.svg + icons/image/svg/production/ic_nature_24px.svg + icons/image/svg/production/ic_nature_people_24px.svg + icons/image/svg/production/ic_navigate_before_24px.svg + icons/image/svg/production/ic_navigate_next_24px.svg + icons/image/svg/production/ic_palette_24px.svg + icons/image/svg/production/ic_panorama_24px.svg + icons/image/svg/production/ic_panorama_fish_eye_24px.svg + icons/image/svg/production/ic_panorama_horizontal_24px.svg + icons/image/svg/production/ic_panorama_vertical_24px.svg + icons/image/svg/production/ic_panorama_wide_angle_24px.svg + icons/image/svg/production/ic_photo_24px.svg + icons/image/svg/production/ic_photo_album_24px.svg + icons/image/svg/production/ic_photo_camera_24px.svg + icons/image/svg/production/ic_photo_filter_24px.svg + icons/image/svg/production/ic_photo_library_24px.svg + icons/image/svg/production/ic_photo_size_select_actual_24px.svg + icons/image/svg/production/ic_photo_size_select_large_24px.svg + icons/image/svg/production/ic_photo_size_select_small_24px.svg + icons/image/svg/production/ic_picture_as_pdf_24px.svg + icons/image/svg/production/ic_portrait_24px.svg + icons/image/svg/production/ic_remove_red_eye_24px.svg + icons/image/svg/production/ic_rotate_90_degrees_ccw_24px.svg + icons/image/svg/production/ic_rotate_left_24px.svg + icons/image/svg/production/ic_rotate_right_24px.svg + icons/image/svg/production/ic_slideshow_24px.svg + icons/image/svg/production/ic_straighten_24px.svg + icons/image/svg/production/ic_style_24px.svg + icons/image/svg/production/ic_switch_camera_24px.svg + icons/image/svg/production/ic_switch_video_24px.svg + icons/image/svg/production/ic_tag_faces_24px.svg + icons/image/svg/production/ic_texture_24px.svg + icons/image/svg/production/ic_timelapse_24px.svg + icons/image/svg/production/ic_timer_3_24px.svg + icons/image/svg/production/ic_timer_10_24px.svg + icons/image/svg/production/ic_timer_24px.svg + icons/image/svg/production/ic_timer_off_24px.svg + icons/image/svg/production/ic_tonality_24px.svg + icons/image/svg/production/ic_transform_24px.svg + icons/image/svg/production/ic_tune_24px.svg + icons/image/svg/production/ic_view_comfy_24px.svg + icons/image/svg/production/ic_view_compact_24px.svg + icons/image/svg/production/ic_vignette_24px.svg + icons/image/svg/production/ic_wb_auto_24px.svg + icons/image/svg/production/ic_wb_cloudy_24px.svg + icons/image/svg/production/ic_wb_incandescent_24px.svg + icons/image/svg/production/ic_wb_iridescent_24px.svg + icons/image/svg/production/ic_wb_sunny_24px.svg + icons/maps/svg/production/ic_add_location_24px.svg + icons/maps/svg/production/ic_beenhere_24px.svg + icons/maps/svg/production/ic_directions_24px.svg + icons/maps/svg/production/ic_directions_bike_24px.svg + icons/maps/svg/production/ic_directions_boat_24px.svg + icons/maps/svg/production/ic_directions_bus_24px.svg + icons/maps/svg/production/ic_directions_car_24px.svg + icons/maps/svg/production/ic_directions_railway_24px.svg + icons/maps/svg/production/ic_directions_run_24px.svg + icons/maps/svg/production/ic_directions_subway_24px.svg + icons/maps/svg/production/ic_directions_transit_24px.svg + icons/maps/svg/production/ic_directions_walk_24px.svg + icons/maps/svg/production/ic_edit_location_24px.svg + icons/maps/svg/production/ic_ev_station_24px.svg + icons/maps/svg/production/ic_flight_24px.svg + icons/maps/svg/production/ic_hotel_24px.svg + icons/maps/svg/production/ic_layers_24px.svg + icons/maps/svg/production/ic_layers_clear_24px.svg + icons/maps/svg/production/ic_local_activity_24px.svg + icons/maps/svg/production/ic_local_airport_24px.svg + icons/maps/svg/production/ic_local_atm_24px.svg + icons/maps/svg/production/ic_local_bar_24px.svg + icons/maps/svg/production/ic_local_cafe_24px.svg + icons/maps/svg/production/ic_local_car_wash_24px.svg + icons/maps/svg/production/ic_local_convenience_store_24px.svg + icons/maps/svg/production/ic_local_dining_24px.svg + icons/maps/svg/production/ic_local_drink_24px.svg + icons/maps/svg/production/ic_local_florist_24px.svg + icons/maps/svg/production/ic_local_gas_station_24px.svg + icons/maps/svg/production/ic_local_grocery_store_24px.svg + icons/maps/svg/production/ic_local_hospital_24px.svg + icons/maps/svg/production/ic_local_hotel_24px.svg + icons/maps/svg/production/ic_local_laundry_service_24px.svg + icons/maps/svg/production/ic_local_library_24px.svg + icons/maps/svg/production/ic_local_mall_24px.svg + icons/maps/svg/production/ic_local_movies_24px.svg + icons/maps/svg/production/ic_local_offer_24px.svg + icons/maps/svg/production/ic_local_parking_24px.svg + icons/maps/svg/production/ic_local_pharmacy_24px.svg + icons/maps/svg/production/ic_local_phone_24px.svg + icons/maps/svg/production/ic_local_pizza_24px.svg + icons/maps/svg/production/ic_local_play_24px.svg + icons/maps/svg/production/ic_local_post_office_24px.svg + icons/maps/svg/production/ic_local_printshop_24px.svg + icons/maps/svg/production/ic_local_see_24px.svg + icons/maps/svg/production/ic_local_shipping_24px.svg + icons/maps/svg/production/ic_local_taxi_24px.svg + icons/maps/svg/production/ic_map_24px.svg + icons/maps/svg/production/ic_my_location_24px.svg + icons/maps/svg/production/ic_navigation_24px.svg + icons/maps/svg/production/ic_near_me_24px.svg + icons/maps/svg/production/ic_person_pin_24px.svg + icons/maps/svg/production/ic_person_pin_circle_24px.svg + icons/maps/svg/production/ic_pin_drop_24px.svg + icons/maps/svg/production/ic_place_24px.svg + icons/maps/svg/production/ic_rate_review_24px.svg + icons/maps/svg/production/ic_restaurant_24px.svg + icons/maps/svg/production/ic_restaurant_menu_24px.svg + icons/maps/svg/production/ic_satellite_24px.svg + icons/maps/svg/production/ic_store_mall_directory_24px.svg + icons/maps/svg/production/ic_streetview_24px.svg + icons/maps/svg/production/ic_subway_24px.svg + icons/maps/svg/production/ic_terrain_24px.svg + icons/maps/svg/production/ic_traffic_24px.svg + icons/maps/svg/production/ic_train_24px.svg + icons/maps/svg/production/ic_tram_24px.svg + icons/maps/svg/production/ic_transfer_within_a_station_24px.svg + icons/maps/svg/production/ic_zoom_out_map_24px.svg + icons/navigation/svg/production/ic_apps_24px.svg + icons/navigation/svg/production/ic_arrow_back_24px.svg + icons/navigation/svg/production/ic_arrow_downward_24px.svg + icons/navigation/svg/production/ic_arrow_drop_down_24px.svg + icons/navigation/svg/production/ic_arrow_drop_down_circle_24px.svg + icons/navigation/svg/production/ic_arrow_drop_up_24px.svg + icons/navigation/svg/production/ic_arrow_forward_24px.svg + icons/navigation/svg/production/ic_arrow_upward_24px.svg + icons/navigation/svg/production/ic_cancel_24px.svg + icons/navigation/svg/production/ic_check_24px.svg + icons/navigation/svg/production/ic_chevron_left_24px.svg + icons/navigation/svg/production/ic_chevron_right_24px.svg + icons/navigation/svg/production/ic_close_24px.svg + icons/navigation/svg/production/ic_expand_less_24px.svg + icons/navigation/svg/production/ic_expand_more_24px.svg + icons/navigation/svg/production/ic_first_page_24px.svg + icons/navigation/svg/production/ic_fullscreen_24px.svg + icons/navigation/svg/production/ic_fullscreen_exit_24px.svg + icons/navigation/svg/production/ic_last_page_24px.svg + icons/navigation/svg/production/ic_menu_24px.svg + icons/navigation/svg/production/ic_more_horiz_24px.svg + icons/navigation/svg/production/ic_more_vert_24px.svg + icons/navigation/svg/production/ic_refresh_24px.svg + icons/navigation/svg/production/ic_subdirectory_arrow_left_24px.svg + icons/navigation/svg/production/ic_subdirectory_arrow_right_24px.svg + icons/navigation/svg/production/ic_unfold_less_24px.svg + icons/navigation/svg/production/ic_unfold_more_24px.svg + icons/notification/svg/production/ic_adb_24px.svg + icons/notification/svg/production/ic_airline_seat_flat_24px.svg + icons/notification/svg/production/ic_airline_seat_flat_angled_24px.svg + icons/notification/svg/production/ic_airline_seat_individual_suite_24px.svg + icons/notification/svg/production/ic_airline_seat_legroom_extra_24px.svg + icons/notification/svg/production/ic_airline_seat_legroom_normal_24px.svg + icons/notification/svg/production/ic_airline_seat_legroom_reduced_24px.svg + icons/notification/svg/production/ic_airline_seat_recline_extra_24px.svg + icons/notification/svg/production/ic_airline_seat_recline_normal_24px.svg + icons/notification/svg/production/ic_bluetooth_audio_24px.svg + icons/notification/svg/production/ic_confirmation_number_24px.svg + icons/notification/svg/production/ic_disc_full_24px.svg + icons/notification/svg/production/ic_do_not_disturb_24px.svg + icons/notification/svg/production/ic_do_not_disturb_alt_24px.svg + icons/notification/svg/production/ic_do_not_disturb_off_24px.svg + icons/notification/svg/production/ic_do_not_disturb_on_24px.svg + icons/notification/svg/production/ic_drive_eta_24px.svg + icons/notification/svg/production/ic_enhanced_encryption_24px.svg + icons/notification/svg/production/ic_event_available_24px.svg + icons/notification/svg/production/ic_event_busy_24px.svg + icons/notification/svg/production/ic_event_note_24px.svg + icons/notification/svg/production/ic_folder_special_24px.svg + icons/notification/svg/production/ic_live_tv_24px.svg + icons/notification/svg/production/ic_mms_24px.svg + icons/notification/svg/production/ic_more_24px.svg + icons/notification/svg/production/ic_network_check_24px.svg + icons/notification/svg/production/ic_network_locked_24px.svg + icons/notification/svg/production/ic_no_encryption_24px.svg + icons/notification/svg/production/ic_ondemand_video_24px.svg + icons/notification/svg/production/ic_personal_video_24px.svg + icons/notification/svg/production/ic_phone_bluetooth_speaker_24px.svg + icons/notification/svg/production/ic_phone_forwarded_24px.svg + icons/notification/svg/production/ic_phone_in_talk_24px.svg + icons/notification/svg/production/ic_phone_locked_24px.svg + icons/notification/svg/production/ic_phone_missed_24px.svg + icons/notification/svg/production/ic_phone_paused_24px.svg + icons/notification/svg/production/ic_power_24px.svg + icons/notification/svg/production/ic_priority_high_24px.svg + icons/notification/svg/production/ic_rv_hookup_24px.svg + icons/notification/svg/production/ic_sd_card_24px.svg + icons/notification/svg/production/ic_sim_card_alert_24px.svg + icons/notification/svg/production/ic_sms_24px.svg + icons/notification/svg/production/ic_sms_failed_24px.svg + icons/notification/svg/production/ic_sync_24px.svg + icons/notification/svg/production/ic_sync_disabled_24px.svg + icons/notification/svg/production/ic_sync_problem_24px.svg + icons/notification/svg/production/ic_system_update_24px.svg + icons/notification/svg/production/ic_tap_and_play_24px.svg + icons/notification/svg/production/ic_time_to_leave_24px.svg + icons/notification/svg/production/ic_vibration_24px.svg + icons/notification/svg/production/ic_voice_chat_24px.svg + icons/notification/svg/production/ic_vpn_lock_24px.svg + icons/notification/svg/production/ic_wc_24px.svg + icons/notification/svg/production/ic_wifi_24px.svg + icons/places/svg/production/ic_ac_unit_24px.svg + icons/places/svg/production/ic_airport_shuttle_24px.svg + icons/places/svg/production/ic_all_inclusive_24px.svg + icons/places/svg/production/ic_beach_access_24px.svg + icons/places/svg/production/ic_business_center_24px.svg + icons/places/svg/production/ic_casino_24px.svg + icons/places/svg/production/ic_child_care_24px.svg + icons/places/svg/production/ic_child_friendly_24px.svg + icons/places/svg/production/ic_fitness_center_24px.svg + icons/places/svg/production/ic_free_breakfast_24px.svg + icons/places/svg/production/ic_golf_course_24px.svg + icons/places/svg/production/ic_hot_tub_24px.svg + icons/places/svg/production/ic_kitchen_24px.svg + icons/places/svg/production/ic_pool_24px.svg + icons/places/svg/production/ic_room_service_24px.svg + icons/places/svg/production/ic_rv_hookup_24px.svg + icons/places/svg/production/ic_smoke_free_24px.svg + icons/places/svg/production/ic_smoking_rooms_24px.svg + icons/places/svg/production/ic_spa_24px.svg + icons/social/svg/production/ic_cake_24px.svg + icons/social/svg/production/ic_domain_24px.svg + icons/social/svg/production/ic_group_24px.svg + icons/social/svg/production/ic_group_add_24px.svg + icons/social/svg/production/ic_location_city_24px.svg + icons/social/svg/production/ic_mood_24px.svg + icons/social/svg/production/ic_mood_bad_24px.svg + icons/social/svg/production/ic_notifications_24px.svg + icons/social/svg/production/ic_notifications_active_24px.svg + icons/social/svg/production/ic_notifications_none_24px.svg + icons/social/svg/production/ic_notifications_off_24px.svg + icons/social/svg/production/ic_notifications_paused_24px.svg + icons/social/svg/production/ic_pages_24px.svg + icons/social/svg/production/ic_party_mode_24px.svg + icons/social/svg/production/ic_people_24px.svg + icons/social/svg/production/ic_people_outline_24px.svg + icons/social/svg/production/ic_person_24px.svg + icons/social/svg/production/ic_person_add_24px.svg + icons/social/svg/production/ic_person_outline_24px.svg + icons/social/svg/production/ic_plus_one_24px.svg + icons/social/svg/production/ic_poll_24px.svg + icons/social/svg/production/ic_public_24px.svg + icons/social/svg/production/ic_school_24px.svg + icons/social/svg/production/ic_sentiment_dissatisfied_24px.svg + icons/social/svg/production/ic_sentiment_neutral_24px.svg + icons/social/svg/production/ic_sentiment_satisfied_24px.svg + icons/social/svg/production/ic_sentiment_very_dissatisfied_24px.svg + icons/social/svg/production/ic_sentiment_very_satisfied_24px.svg + icons/social/svg/production/ic_share_24px.svg + icons/social/svg/production/ic_whatshot_24px.svg + +