forked from quickshell/quickshell
		
	ui/reload: add textual fallback for copy and close icons
This commit is contained in:
		
							parent
							
								
									56b4ef3d21
								
							
						
					
					
						commit
						c77a12d7bb
					
				
					 2 changed files with 23 additions and 6 deletions
				
			
		| 
						 | 
					@ -58,7 +58,8 @@ PanelWindow {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	component TopButton: WrapperMouseArea {
 | 
						component TopButton: WrapperMouseArea {
 | 
				
			||||||
		id: buttonMouse
 | 
							id: buttonMouse
 | 
				
			||||||
		property alias image: image.source
 | 
							required property string icon
 | 
				
			||||||
 | 
							required property string fallbackText
 | 
				
			||||||
		property bool red: false
 | 
							property bool red: false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		hoverEnabled: true
 | 
							hoverEnabled: true
 | 
				
			||||||
| 
						 | 
					@ -95,7 +96,20 @@ PanelWindow {
 | 
				
			||||||
			Behavior on color { ColorAnimation { duration: 100 } }
 | 
								Behavior on color { ColorAnimation { duration: 100 } }
 | 
				
			||||||
			Behavior on border.color { ColorAnimation { duration: 100 } }
 | 
								Behavior on border.color { ColorAnimation { duration: 100 } }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			IconImage { id: image; implicitSize: 22 }
 | 
								IconImage {
 | 
				
			||||||
 | 
									id: image
 | 
				
			||||||
 | 
									source: Quickshell.iconPath(buttonMouse.icon, true)
 | 
				
			||||||
 | 
									implicitSize: 22
 | 
				
			||||||
 | 
									visible: source != ""
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								Text {
 | 
				
			||||||
 | 
									id: fallback
 | 
				
			||||||
 | 
									text: buttonMouse.fallbackText
 | 
				
			||||||
 | 
									color: buttonMouse.red ? "white" : palette.active.buttonText
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								child: image.visible ? image : fallback
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -130,7 +144,8 @@ PanelWindow {
 | 
				
			||||||
				TopButton {
 | 
									TopButton {
 | 
				
			||||||
					id: copyButton
 | 
										id: copyButton
 | 
				
			||||||
					visible: root.failed
 | 
										visible: root.failed
 | 
				
			||||||
					image: Quickshell.iconPath("edit-copy")
 | 
										icon: "edit-copy"
 | 
				
			||||||
 | 
										fallbackText: "Copy"
 | 
				
			||||||
					onClicked: {
 | 
										onClicked: {
 | 
				
			||||||
						Quickshell.clipboardText = root.errorString;
 | 
											Quickshell.clipboardText = root.errorString;
 | 
				
			||||||
						copyTooltip.showAction();
 | 
											copyTooltip.showAction();
 | 
				
			||||||
| 
						 | 
					@ -146,7 +161,8 @@ PanelWindow {
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				TopButton {
 | 
									TopButton {
 | 
				
			||||||
					image: Quickshell.iconPath("window-close")
 | 
										icon: "window-close"
 | 
				
			||||||
 | 
										fallbackText: "Close"
 | 
				
			||||||
					red: true
 | 
										red: true
 | 
				
			||||||
					onClicked: {
 | 
										onClicked: {
 | 
				
			||||||
						fadeOutAnim.stop()
 | 
											fadeOutAnim.stop()
 | 
				
			||||||
| 
						 | 
					@ -216,7 +232,8 @@ PanelWindow {
 | 
				
			||||||
							IconImage {
 | 
												IconImage {
 | 
				
			||||||
								Layout.fillHeight: true
 | 
													Layout.fillHeight: true
 | 
				
			||||||
								implicitWidth: height
 | 
													implicitWidth: height
 | 
				
			||||||
								source: Quickshell.iconPath("edit-copy")
 | 
													source: Quickshell.iconPath("edit-copy", true)
 | 
				
			||||||
 | 
													visible: source != ""
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -39,7 +39,7 @@ void ReloadPopup::closed() {
 | 
				
			||||||
		this->deleting = true;
 | 
							this->deleting = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		QTimer::singleShot(0, [this]() {
 | 
							QTimer::singleShot(0, [this]() {
 | 
				
			||||||
			this->popup->deleteLater();
 | 
								if (this->popup) this->popup->deleteLater();
 | 
				
			||||||
			this->generation->destroy();
 | 
								this->generation->destroy();
 | 
				
			||||||
			this->deleteLater();
 | 
								this->deleteLater();
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue