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 {
 | 
			
		||||
		id: buttonMouse
 | 
			
		||||
		property alias image: image.source
 | 
			
		||||
		required property string icon
 | 
			
		||||
		required property string fallbackText
 | 
			
		||||
		property bool red: false
 | 
			
		||||
 | 
			
		||||
		hoverEnabled: true
 | 
			
		||||
| 
						 | 
				
			
			@ -95,7 +96,20 @@ PanelWindow {
 | 
			
		|||
			Behavior on 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 {
 | 
			
		||||
					id: copyButton
 | 
			
		||||
					visible: root.failed
 | 
			
		||||
					image: Quickshell.iconPath("edit-copy")
 | 
			
		||||
					icon: "edit-copy"
 | 
			
		||||
					fallbackText: "Copy"
 | 
			
		||||
					onClicked: {
 | 
			
		||||
						Quickshell.clipboardText = root.errorString;
 | 
			
		||||
						copyTooltip.showAction();
 | 
			
		||||
| 
						 | 
				
			
			@ -146,7 +161,8 @@ PanelWindow {
 | 
			
		|||
				}
 | 
			
		||||
 | 
			
		||||
				TopButton {
 | 
			
		||||
					image: Quickshell.iconPath("window-close")
 | 
			
		||||
					icon: "window-close"
 | 
			
		||||
					fallbackText: "Close"
 | 
			
		||||
					red: true
 | 
			
		||||
					onClicked: {
 | 
			
		||||
						fadeOutAnim.stop()
 | 
			
		||||
| 
						 | 
				
			
			@ -216,7 +232,8 @@ PanelWindow {
 | 
			
		|||
							IconImage {
 | 
			
		||||
								Layout.fillHeight: true
 | 
			
		||||
								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;
 | 
			
		||||
 | 
			
		||||
		QTimer::singleShot(0, [this]() {
 | 
			
		||||
			this->popup->deleteLater();
 | 
			
		||||
			if (this->popup) this->popup->deleteLater();
 | 
			
		||||
			this->generation->destroy();
 | 
			
		||||
			this->deleteLater();
 | 
			
		||||
		});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue