From 93d8314feecbc1ec9c360002b82dfe049538f799 Mon Sep 17 00:00:00 2001 From: Daniil Vinogradov Date: Sun, 16 Mar 2025 14:00:45 +0100 Subject: [PATCH] Code cleanup --- Demo/CMakeLists.txt | 2 -- Demo/app/AppDelegate.cpp | 7 +------ NXKit/CMakeLists.txt | 2 ++ NXKit/include/NXKit.h | 4 +++- .../include}/NXNavigationController.h | 0 .../NXTextScreen => NXKit/include}/NXTabBarController.h | 0 .../NXTextScreen => NXKit/lib}/NXNavigationController.cpp | 0 .../NXTextScreen => NXKit/lib}/NXTabBarController.cpp | 0 UIKitCore/include/UIKit.h | 1 + UIKitCore/lib/CABlurLayer.cpp | 2 +- UIKitCore/lib/UIView.cpp | 6 +++--- 11 files changed, 11 insertions(+), 13 deletions(-) rename {Demo/app/Screens/NXTextScreen => NXKit/include}/NXNavigationController.h (100%) rename {Demo/app/Screens/NXTextScreen => NXKit/include}/NXTabBarController.h (100%) rename {Demo/app/Screens/NXTextScreen => NXKit/lib}/NXNavigationController.cpp (100%) rename {Demo/app/Screens/NXTextScreen => NXKit/lib}/NXTabBarController.cpp (100%) diff --git a/Demo/CMakeLists.txt b/Demo/CMakeLists.txt index 2f044cb..06d0d47 100644 --- a/Demo/CMakeLists.txt +++ b/Demo/CMakeLists.txt @@ -24,8 +24,6 @@ add_executable(${PROJECT_NAME} app/Screens/TestViewController/TestViewController.cpp app/Screens/YogaTestViewController/YogaTestViewController.cpp app/Screens/IBTestController/IBTestController.cpp - app/Screens/NXTextScreen/NXNavigationController.cpp - app/Screens/NXTextScreen/NXTabBarController.cpp ) target_include_directories(${PROJECT_NAME} PUBLIC diff --git a/Demo/app/AppDelegate.cpp b/Demo/app/AppDelegate.cpp index ac72ddc..b21826a 100644 --- a/Demo/app/AppDelegate.cpp +++ b/Demo/app/AppDelegate.cpp @@ -1,12 +1,7 @@ -#include -#include -#include -#include +#include #include #include #include -#include -#include // #include // #include #include diff --git a/NXKit/CMakeLists.txt b/NXKit/CMakeLists.txt index cc48fa2..8053945 100644 --- a/NXKit/CMakeLists.txt +++ b/NXKit/CMakeLists.txt @@ -2,7 +2,9 @@ project(NXKit) add_library(NXKit lib/NXControl.cpp + lib/NXNavigationController.cpp lib/NXSeparatorView.cpp + lib/NXTabBarController.cpp ) target_include_directories(NXKit PUBLIC diff --git a/NXKit/include/NXKit.h b/NXKit/include/NXKit.h index cda5143..cb4ad9d 100644 --- a/NXKit/include/NXKit.h +++ b/NXKit/include/NXKit.h @@ -7,4 +7,6 @@ #include #include -#include \ No newline at end of file +#include +#include +#include \ No newline at end of file diff --git a/Demo/app/Screens/NXTextScreen/NXNavigationController.h b/NXKit/include/NXNavigationController.h similarity index 100% rename from Demo/app/Screens/NXTextScreen/NXNavigationController.h rename to NXKit/include/NXNavigationController.h diff --git a/Demo/app/Screens/NXTextScreen/NXTabBarController.h b/NXKit/include/NXTabBarController.h similarity index 100% rename from Demo/app/Screens/NXTextScreen/NXTabBarController.h rename to NXKit/include/NXTabBarController.h diff --git a/Demo/app/Screens/NXTextScreen/NXNavigationController.cpp b/NXKit/lib/NXNavigationController.cpp similarity index 100% rename from Demo/app/Screens/NXTextScreen/NXNavigationController.cpp rename to NXKit/lib/NXNavigationController.cpp diff --git a/Demo/app/Screens/NXTextScreen/NXTabBarController.cpp b/NXKit/lib/NXTabBarController.cpp similarity index 100% rename from Demo/app/Screens/NXTextScreen/NXTabBarController.cpp rename to NXKit/lib/NXTabBarController.cpp diff --git a/UIKitCore/include/UIKit.h b/UIKitCore/include/UIKit.h index d52d144..6afffb2 100644 --- a/UIKitCore/include/UIKit.h +++ b/UIKitCore/include/UIKit.h @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff --git a/UIKitCore/lib/CABlurLayer.cpp b/UIKitCore/lib/CABlurLayer.cpp index 1961531..fe0f5dd 100644 --- a/UIKitCore/lib/CABlurLayer.cpp +++ b/UIKitCore/lib/CABlurLayer.cpp @@ -26,7 +26,7 @@ void CABlurLayer::draw(SkCanvas* context) { sk_sp newBlurFilter = SkImageFilters::Blur(_blurRadius, _blurRadius, SkTileMode::kClamp, nullptr); blurPaint.setImageFilter(std::move(newBlurFilter)); -// + context->save(); SkRect rect = SkRect::MakeXYWH(0, 0, bounds().width(), bounds().height()); diff --git a/UIKitCore/lib/UIView.cpp b/UIKitCore/lib/UIView.cpp index 6b3553c..5381f45 100644 --- a/UIKitCore/lib/UIView.cpp +++ b/UIKitCore/lib/UIView.cpp @@ -110,14 +110,14 @@ void UIView::setFrame(NXRect frame) { setNeedsLayout(); } _layer->setFrame(frame); -// setNeedsUpdateSafeAreaInsets(); + setNeedsUpdateSafeAreaInsets(); } void UIView::setBounds(NXRect bounds) { if (this->bounds().size != bounds.size) { setNeedsDisplay(); setNeedsLayout(); -// setNeedsUpdateSafeAreaInsets(); + setNeedsUpdateSafeAreaInsets(); } _layer->setBounds(bounds); } @@ -795,7 +795,7 @@ void UIView::layoutSubviews() { // updateEdgeInsets(); _yoga->layoutIfNeeded(); // yoga->applyLayoutPreservingOrigin(true); -// updateSafeAreaInsets(); + updateSafeAreaInsets(); if (!_parentController.expired()) { _parentController.lock()->viewDidLayoutSubviews();