diff --git a/main/main.py b/main/main.py index 4fc77aa..d226af2 100644 --- a/main/main.py +++ b/main/main.py @@ -183,9 +183,6 @@ class MainWidget(QWidget): self.system_listWidget.setItemWidget(item, item.widget) - def change(self): - print(1) - # 点击创建新的分组 def create_item(self, new_list='新建列表', uid=None): # 创建一个没有名字的item diff --git a/view/ImportantView.py b/view/ImportantView.py index 6c7a6c2..416749e 100644 --- a/view/ImportantView.py +++ b/view/ImportantView.py @@ -26,7 +26,7 @@ class Important(QWidget): background = get_myday_important_conf('Important', 'Theme') if not background: - background = '0' + background = '8' self.setStyleSheet('#important{background-image:url("../images/' + background + '.jpg");border-radius: 10px;}') diff --git a/view/MyDayView.py b/view/MyDayView.py index dbcd195..c36d601 100644 --- a/view/MyDayView.py +++ b/view/MyDayView.py @@ -6,7 +6,7 @@ from PyQt5.QtWidgets import * from PyQt5.QtCore import Qt, pyqtSignal from utils.BasicUtils import load_myday_important, remove_todo_list, change_value, change_myday_important_conf -from utils.CreateToDo import CreateToDo +from utils.CreateToDo import CreateToDo, create_myday_important from view.AddToDoLabel import AddToDoAction from view.MyDayHeadLabel import HeadLabel from view.ToDoItem import ToDoItem @@ -170,10 +170,20 @@ class MyDay(QWidget): if name: self.add_todo.todo_name.emit(name) # print('添加的新ToDo:' + name) - todo_item = ToDoItem(name) + create_todo = CreateToDo('Todo', name) + change_value(create_todo, 'isMyDay', True) + todo_item = ToDoItem(name, create_todo) self.todo_list.addItem(todo_item) self.todo_list.setItemWidget(todo_item, todo_item.widget) self.add_todo.line_edit.clear() + self.update_signal.emit() + # self.add_todo.todo_name.emit(name) + # # print('添加的新ToDo:' + name) + # todo_item = ToDoItem(name) + # change_value(create_todo, 'isImportant', True) + # self.todo_list.addItem(todo_item) + # self.todo_list.setItemWidget(todo_item, todo_item.widget) + # self.add_todo.line_edit.clear() def todo_list_context(self, position): # 设置右键菜单 @@ -252,8 +262,8 @@ class MyDay(QWidget): self.dialog.exec_() def change_name(self, item_name): - print(item_name) - my_day_list = load_myday_important('Important') + # print(item_name) + my_day_list = load_myday_important('MyDay') change_value(my_day_list[self.todo_list.currentRow()][1], 'title', item_name) # 重命名发送信号 self.refresh_action() diff --git a/view/ToDoListView.py b/view/ToDoListView.py index d554c99..fb11314 100644 --- a/view/ToDoListView.py +++ b/view/ToDoListView.py @@ -24,7 +24,7 @@ class ToDoList(QWidget): super(ToDoList, self).__init__() self.setObjectName('todolist') self.setAttribute(Qt.WA_StyledBackground) - # todo : 使用网格布局设置背景图 + self.setStyleSheet('#todolist{background-image:url("../images/10.jpg");border-radius: 10px;}') # 布局样式:最外面一个大的垂直布局,里面的最上面标题是一个水平布局,水平布局显示的是一个垂直布局和一个右边的选项,用来更换背景