Code Monkey home page Code Monkey logo

pyqt-siliconui's Introduction

Hi there 👋

I'm IceF, currently a student from Beihang University. Coding for fun. Trying everything.

I am currently working on:

PyQt-SiliconUI: A powerful and artistic UI library based on PyQt5

My-TODOs: A cross-platform desktop To-Do list.

pyqt-siliconui's People

Contributors

chinaicef avatar h1ddenadm1n avatar rainzee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pyqt-siliconui's Issues

迁移`SiButton.py`模块

TODO

  • 从该模块中抽象出基础控件,并在components/widgets中创建button模块并存放这些基础控件
  • components中创建button模块,提供SiButton SiButtonLabel SiButtonFlat SiButtonFlatWithLabel SiButtonHoldToComfirm控件

Optimize programming experience

To Realize

These improvements will be implemented to optimize the experience of programmers in modern editors.

  • Make a distinction between private methods and public methods.
  • Add docstring to all public methods of each widgets.
  • Improve project structure: widgets should be put into a folder widgets, while those are not widgets (like animation objects) should be in folder abstracts

迁移``SiAnimationObjects.py``模块

TODO

  • 构建抽象类ABCSiAnimation,整合在siui/core/animation/abstract.py模块中,它是所有动画对象的基类,提供计时器,启停控制,设置当前值,目标值,进度计数器和ticked信号。为了对数组提供支持,这个类引入numpy以提高输入和输出值的灵活性

  • 构建SiCounterAnimation,整合在siui/core/animation/animation.py模块中。它继承ABCSiAnimation,具有以下特性:

    • 动画曲线:需指定一个函数,其在输入值x属于0到1上的输出作为动画的差值系数
    • 具有设定的总刻数:设定动画运行的时长时,其根据设置的帧率计算出总刻数,运行完整的动画总会输出这么多刻
    • 可逆:提供接口更改动画进行的方向
  • 构建SiExpAnimation,整合在siui/core/animation/animation.py模块中。它继承ABCSiAnimation,具有以下特性:

    • 需指定参数factorbias
    • 公式形式恒定

enhancements

love the project!. but consider making the project available in English to allow for more contributors. Additionally, explore the possibility of creating a Qt Designer plugin for it.

Modernize and standardize this project

Abstract & Motivation

This proposal aims to enhance the standardization and modernization of the component library, focusing on improving the developer experience and overall code quality.

As one of the maintainers of PyQt-Fluent-Widgets, I understand the significant benefits of standardizing and modernizing our codebase. These benefits include improved code writing experiences, enhanced error checking, seamless continuous integration, reduced errors, and performance improvements.

Implementation

We will achieve our goals through a series of progressive PRs

  • use https://semver.org/ as the versioning standard
  • use pyproject.toml to centralize and standardize project configuration.
  • use ruff as the default linter and configure the rules
  • add git ignore file for python project
  • use ruff as the default formatter and configure the line width
  • specify the minimum Python version and configure it in pyproject.toml and pyright to standardize syntax and ensure compatibility
  • use https://github.com/python-qt-tools/PyQt5-stubs as the stubs for improve the Qt's default stbus.
  • configure linters in continuous integration to ensure that all PRs comply with specifications
  • #18
  • unify naming conventions: modules should follow snake_case, while variables should adopt Qt’s smallCamelCase style.

使用 `VS Code` 直接运行 `./examples/Gallery/start.py` 各种报错找不到文件

我是这样成功把它跑起来的,手动修正相对路径,不知道标准不,但能用:

A731PDVAW51)F5 XFZ{~2TH

QQ 群友反馈 PyCharm 无须改动可以直接运行:

图片

但是,还是希望您可以照顾下 VS Code 用户,规范相对路径 或 绝对路径。

我的环境:

┏[user0][main]
┖[~\Documents\PyQt-SiliconUI]> pdm list --tree
numpy 2.0.0 [ required: >=2.0.0 ]
pyqt5 5.15.10 [ required: >=5.15.10 ]
├── pyqt5-qt5 5.15.2 [ required: >=5.15.2 ]
└── pyqt5-sip 12.13.0 [ required: <13,>=12.13 ]
setuptools 70.1.1 [ required: >=70.1.1 ]
┏[user0][main]
┖[~\Documents\PyQt-SiliconUI]> pdm info && pdm info --env
PDM version:
  2.16.1    
Python Interpreter:
  C:\Users\user0\Documents\PyQt-SiliconUI\.venv\Scripts\python.exe (3.12)
Project Root:
  C:/Users/user0/Documents/PyQt-SiliconUI
Local Packages:
  
{
  "implementation_name": "cpython",
  "implementation_version": "3.12.4",
  "os_name": "nt",
  "platform_machine": "AMD64",
  "platform_release": "10",
  "platform_system": "Windows",
  "platform_version": "10.0.19044",
  "python_full_version": "3.12.4",
  "platform_python_implementation": "CPython",
  "python_version": "3.12",
  "sys_platform": "win32"
}

Write enum class `SiColor`

  • simply realize enumurate color
  • write method tspr and mix which allow user to perform colors more easily

下拉菜单报错

如题 点击下拉菜单后出现如下报错
image
屏幕截图 2024-06-22 163650

Traceback (most recent call last):
File "C:\Users\Howard Jones\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyqt_siliconui-1.1-py3.12.egg\SiliconUI\SiMenu.py", line 215, in _popupAnimationHandler
TypeError: arguments did not match any overloaded call:
resize(self, a0: QSize): argument 1 has unexpected type 'int'
resize(self, w: int, h: int): argument 2 has unexpected type 'float'

一些建议

Ui组件都灰常好看!但是也有一些美中不足的地方。

  1. 标题栏
    image
    这个奇怪的标题栏既不能自适应系统主题,也不能同步程序界面内的颜色,只能说是拉的一批(

可以尝试用 css 把原生的去掉,再手动绘制一个捏。不介意的话,我可以帮你们改改


  1. 不知道是不是我的错觉,就感觉整个ui在滚动的时候都是卡卡的。

  2. 滚动灵敏度太高辣
    对于我这种使用笔记本电脑原生的触控板手势进行滚动的人不太友好,滚得太快辣

下拉菜单错位(Linux平台)

点击下拉菜单有概率错位,收回后再次点击则正常,控制台除了可能是系统原因引发的错误没有任何其他输出
图片

运行环境: Arch Linux 6.9.4, KDE Plasma 6.0.5, Wayland 1.23.0, Qt 6.7.1, Python 3.12.4
Python模块版本: pyqt5 5.15.10, pyside6 6.7.1
不会是因为系统吧(

progress_bar.py文件报错

当我打开示例项目滑动滚动条时出现了报错,其中siui\components\progress_bar\progress_bar.py文件255行有一个错误

Traceback (most recent call last):
  File "F:\PyQt-SiliconUI\siui\components\progress_bar\progress_bar.py", line 255, in paintEvent
    painter.drawArc(rect, start_angle, span_angle)
TypeError: arguments did not match any overloaded call:
  drawArc(self, rect: QRectF, a: int, alen: int): argument 1 has unexpected type 'QRect'
  drawArc(self, r: QRect, a: int, alen: int): argument 2 has unexpected type 'float'
  drawArc(self, x: int, y: int, w: int, h: int, a: int, alen: int): argument 1 has unexpected type 'QRect'

需要把painter.drawArc(rect, start_angle, span_angle)
改为painter.drawArc(rect, int(start_angle), int(span_angle))

迁移`SiLabel.py`模块

TODO

  • SiLabel中抽象出基础控件,并在components/widgets下创建label模块,将抽象出的基础控件写入label模块
  • components中创建label.py,并迁移SiLabel中三个控件SiLabel SiPixLabel SiDraggableLabel

[BUG] 侧边栏信息导致滚动卡顿

当侧边栏信息增加的时候 切换到可滚动的页面会明显感觉到卡顿。且侧边栏信息越多越卡顿。

附[建议]:可以考虑部分侧边栏信息自动消失

Use enum instead of dict when using global variables (fonts and colors)

New Features

  • new feat: write new class SiColor which provides token for getting colors, 64 member names will be allocated to every type of widgets
  • new feat: write SiColorGroup to replace dict and to unify all color sets in the whole project. A global color set will be instantiated acting as the theme color set which can be adopt to every SiliconUI widgets, while private color set can also be instantiated, allowing more flexible color managing.

Reconsturctions

微调项目结构

把components中各个组件打包,并将widgets包作为components的子包

Mac 电脑不兼容

python ui.py
当前工作目录 ui.py
无法获取缩放比例,设置为1,错误: module 'ctypes' has no attribute 'windll'

系统找不到指定路径

  File "e:\Desktop\PyQt-SiliconUI-main\examples\Gallery for siui\start.py", line 7, in <module>
    from siui.core.globals import SiGlobal
  File "D:\appFoundation\Python\Python312\Lib\site-packages\pyqt_siliconui-1.0.1-py3.12.egg\siui\__init__.py", line 4, in <module>
    import siui.components as components
  File "D:\appFoundation\Python\Python312\Lib\site-packages\pyqt_siliconui-1.0.1-py3.12.egg\siui\components\__init__.py", line 1, in <module>
    from siui.components.option_card import *
  File "D:\appFoundation\Python\Python312\Lib\site-packages\pyqt_siliconui-1.0.1-py3.12.egg\siui\components\option_card\__init__.py", line 1, in <module>  
    from siui.components.option_card.option_card import *
  File "D:\appFoundation\Python\Python312\Lib\site-packages\pyqt_siliconui-1.0.1-py3.12.egg\siui\components\option_card\option_card.py", line 3, in <module>
    from siui.components.option_card.abstracts.option_card import ABCSiOptionCardPlane
  File "D:\appFoundation\Python\Python312\Lib\site-packages\pyqt_siliconui-1.0.1-py3.12.egg\siui\components\option_card\abstracts\__init__.py", line 1, in <module>
    from siui.components.option_card.abstracts.option_card import ABCSiOptionCardPlane
  File "D:\appFoundation\Python\Python312\Lib\site-packages\pyqt_siliconui-1.0.1-py3.12.egg\siui\components\option_card\abstracts\option_card.py", line 1, in <module>
    from siui.components.widgets import SiDenseHContainer, SiDenseVContainer, SiLabel
  File "D:\appFoundation\Python\Python312\Lib\site-packages\pyqt_siliconui-1.0.1-py3.12.egg\siui\components\widgets\__init__.py", line 1, in <module>      
    import siui.components.widgets.abstracts as abstarcts
  File "D:\appFoundation\Python\Python312\Lib\site-packages\pyqt_siliconui-1.0.1-py3.12.egg\siui\components\widgets\abstracts\__init__.py", line 2, in <module>
    from siui.components.widgets.abstracts.button import *
  File "D:\appFoundation\Python\Python312\Lib\site-packages\pyqt_siliconui-1.0.1-py3.12.egg\siui\components\widgets\abstracts\button.py", line 7, in <module>
    from siui.components.widgets.abstracts.widget import SiWidget
  File "D:\appFoundation\Python\Python312\Lib\site-packages\pyqt_siliconui-1.0.1-py3.12.egg\siui\components\widgets\abstracts\widget.py", line 9, in <module>
    from siui.core.globals import SiGlobal
  File "D:\appFoundation\Python\Python312\Lib\site-packages\pyqt_siliconui-1.0.1-py3.12.egg\siui\core\globals\__init__.py", line 1, in <module>
    from siui.core.globals.globals import SiGlobal
  File "D:\appFoundation\Python\Python312\Lib\site-packages\pyqt_siliconui-1.0.1-py3.12.egg\siui\core\globals\globals.py", line 9, in <module>
    class SiliconUIGlobal:
  File "D:\appFoundation\Python\Python312\Lib\site-packages\pyqt_siliconui-1.0.1-py3.12.egg\siui\core\globals\globals.py", line 24, in SiliconUIGlobal     
    iconpack = SiGlobalIconPack()
               ^^^^^^^^^^^^^^^^^^
  File "D:\appFoundation\Python\Python312\Lib\site-packages\pyqt_siliconui-1.0.1-py3.12.egg\siui\gui\icons\parser.py", line 19, in __init__
    self.reload_internals()
  File "D:\appFoundation\Python\Python312\Lib\site-packages\pyqt_siliconui-1.0.1-py3.12.egg\siui\gui\icons\parser.py", line 25, in reload_internals
    for package_filename in os.listdir(self.package_folder_path):
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 3] 系统找不到指定的路径。: 'D:\\appFoundation\\Python\\Python312\\Lib\\site-packages\\pyqt_siliconui-1.0.1-py3.12.egg\\siui\\gui\\icons\\packages'```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.