修复几个小bug

This commit is contained in:
liyp 2022-04-16 21:45:29 +08:00
parent 3aed356b27
commit c6d49c4af4
13 changed files with 48 additions and 20 deletions

View file

@ -8,7 +8,7 @@
- [ ] 待办事项列表功能实现 - [ ] 待办事项列表功能实现
- [ ] 待办事项列表右键功能实现 - [ ] 待办事项列表右键功能实现
- [ ] 右边`QStackLayout`布局 - [ ] 右边`QStackLayout`布局
- [ ] “我的一天”和“重要”布局实现 - [x] “我的一天”和“重要”布局实现
- [ ] 添加的通用布局实现 - [ ] 添加的通用布局实现
- [ ] 更换主题功能 - [ ] 更换主题功能
- [ ] 登录`nextcloud`及其他`WebDav`和同步功能 - [ ] 登录`nextcloud`及其他`WebDav`和同步功能

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.9 KiB

1
images/icon/冲浪.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.4 KiB

1
images/icon/星宿.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.5 KiB

1
images/icon/沙滩.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 4.9 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.2 KiB

1
images/icon/购物.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -26,12 +26,9 @@ class MainWidget(QWidget):
self.system_listWidget.setFrameShape(QListWidget.NoFrame) self.system_listWidget.setFrameShape(QListWidget.NoFrame)
self.sub_layout.addWidget(self.system_listWidget, 15) self.sub_layout.addWidget(self.system_listWidget, 15)
# 可自定义添加的listWidget
# self.custom = QListWidget(self)
# self.sub_layout.addWidget(self.custom, 7)
# 添加最下边的QLabel # 添加最下边的QLabel
self.add_list_action = AddListAction() self.add_list_action = AddListAction()
self.add_list_action.create_todo_list.connect(self.CreateNewItem)
# self.add_item_label.setPixmap(QPixmap()) # self.add_item_label.setPixmap(QPixmap())
self.sub_layout.addWidget(self.add_list_action, 1) self.sub_layout.addWidget(self.add_list_action, 1)
@ -104,13 +101,14 @@ class MainWidget(QWidget):
# 创建新的分组 # 创建新的分组
def CreateNewItem(self): def CreateNewItem(self):
# 创建一个没有名字的item # 创建一个没有名字的item
item = QListWidgetItem("") item = SelfListWidgetItem('新建列表')
item.setTextAlignment(Qt.AlignCenter) item.setTextAlignment(Qt.AlignCenter)
# 使得item是可以编辑的. # 使得item是可以编辑的.
item.setFlags(item.flags() | Qt.ItemIsEditable) item.setFlags(item.flags() | Qt.ItemIsEditable)
self.custom.addItem(item) self.system_listWidget.addItem(item)
# 创建后就可以编辑item,用户自己起名字. # 创建后就可以编辑item,用户自己起名字.
self.custom.editItem(item) # self.system_listWidget.editItem(item)
self.system_listWidget.setItemWidget(item, item.widget)
# 删除分组 # 删除分组
def DeleteItem(self): def DeleteItem(self):

View file

@ -1,10 +1,10 @@
/*去掉item虚线边框*/ /*去掉item虚线边框*/
* { /** {*/
/* background: #f3f3f3;*/ /* background: #f3f3f3;*/
/* color: black ;*/ /* color: black ;*/
padding:0px; /*padding:0px;*/
margin:0px; /*margin:0px;*/
} /*}*/
QListWidget, QListView, QTreeWidget, QTreeView { QListWidget, QListView, QTreeWidget, QTreeView {
outline-style: 0px; outline-style: 0px;
@ -41,7 +41,8 @@ QListWidget::item {
QListWidget#todo_list{ QListWidget#todo_list{
min-width:700px; min-width:700px;
min-height:650px; min-height:520px;
/* max-height:600px;*/
border-top-left-radius:3px; border-top-left-radius:3px;
border-top-right-radius:3px; border-top-right-radius:3px;
border-bottom-left-radius:3px; border-bottom-left-radius:3px;
@ -210,8 +211,10 @@ QLabel#time_label{
/*堆栈页面的 通用 头部标题文字*/ /*堆栈页面的 通用 头部标题文字*/
QLabel#head_label{ QLabel#head_label{
min-height:150px;
margin-left: 30px; margin-left: 30px;
color:white; color:white;
background-color:red;
font-weight:bold; font-weight:bold;
} }

View file

@ -0,0 +1,15 @@
from webdav3.client import Client
import configparser
options = {
'webdav_hostname': "https://cloud.liyp.cc/remote.php/dav/files/admin/",
'webdav_login': "admin",
'webdav_password': ""
}
client = Client(options)
# client.execute_request('list')
list1 = client.list('/')
print(list1)
exist = client.check('OpenTodoList')
print(exist)

View file

@ -1,10 +1,13 @@
import os import os
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtGui import * from PyQt5.QtGui import *
from PyQt5.QtWidgets import * from PyQt5.QtWidgets import *
class AddListAction(QLabel): class AddListAction(QLabel):
create_todo_list = pyqtSignal()
def __init__(self): def __init__(self):
super(AddListAction, self).__init__() super(AddListAction, self).__init__()
self.widget = QWidget(self) self.widget = QWidget(self)
@ -21,10 +24,11 @@ class AddListAction(QLabel):
layout.addWidget(self.add_image, 3) layout.addWidget(self.add_image, 3)
layout.addWidget(self.add_text, 4) layout.addWidget(self.add_text, 4)
def mousePressEvent(self, QMouseEvent): # def mousePressEvent(self, QMouseEvent):
print('按下QLabel') # print('按下QLabel')
self.setStyleSheet('background-color:#9f9f9f;') # self.setStyleSheet('background-color:#9f9f9f;')
def mouseReleaseEvent(self, QMouseEvent): def mouseReleaseEvent(self, QMouseEvent):
print('释放QLabel') print('释放QLabel')
self.create_todo_list.emit()
self.setStyleSheet('background-color:#eaeaea;') self.setStyleSheet('background-color:#eaeaea;')

View file

@ -10,7 +10,7 @@ class HeadLabel(QLabel):
self.setScaledContents(True) self.setScaledContents(True)
self.setObjectName('head_label') self.setObjectName('head_label')
layout = QVBoxLayout() layout = QVBoxLayout()
self.setMinimumHeight(170) # self.setMinimumHeight(170)
# 设置当前时间 # 设置当前时间
weekday = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"] weekday = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"]

View file

@ -30,16 +30,16 @@ class MyDay(QWidget):
head_layout = QHBoxLayout() # 头部总布局 head_layout = QHBoxLayout() # 头部总布局
head_widget = QWidget(self) head_widget = QWidget(self)
head_widget.setMinimumHeight(175) # head_widget.setMinimumHeight(175)
head_widget.setMaximumHeight(200) # head_widget.setMaximumHeight(180)
head_widget.setAttribute(Qt.WA_StyledBackground) head_widget.setAttribute(Qt.WA_StyledBackground)
self.todo_list = QListWidget() self.todo_list = QListWidget()
self.todo_list.setFrameShape(QListWidget.NoFrame) self.todo_list.setFrameShape(QListWidget.NoFrame)
self.todo_list.setObjectName('todo_list') self.todo_list.setObjectName('todo_list')
# 添加ToDo标签 # 最下面的添加ToDo标签
self.add_todo = AddToDoAction() self.add_todo = AddToDoAction()
self.add_todo.line_edit.returnPressed.connect(lambda: self.line_edit_add(self.add_todo.line_edit.text())) self.add_todo.line_edit.returnPressed.connect(lambda: self.line_edit_add(self.add_todo.line_edit.text()))
self.add_todo.setAlignment(Qt.AlignCenter) self.add_todo.setAlignment(Qt.AlignCenter)
@ -52,6 +52,8 @@ class MyDay(QWidget):
# head_left_layout = QVBoxLayout() # head_left_layout = QVBoxLayout()
layout.addWidget(head_widget, 2, Qt.AlignTop) layout.addWidget(head_widget, 2, Qt.AlignTop)
# layout.addSpacing(1)
self.head_label = HeadLabel() self.head_label = HeadLabel()
layout.addWidget(self.todo_list, 6, Qt.AlignCenter | Qt.AlignTop) layout.addWidget(self.todo_list, 6, Qt.AlignCenter | Qt.AlignTop)
head_layout.addWidget(self.head_label, 8) head_layout.addWidget(self.head_label, 8)