Introduce KeyboardInteractivity enum
This commit is contained in:
		
							parent
							
								
									549f5ad682
								
							
						
					
					
						commit
						11a811061f
					
				
					 6 changed files with 95 additions and 20 deletions
				
			
		| 
						 | 
				
			
			@ -24,7 +24,7 @@ public:
 | 
			
		|||
    QString scope = QStringLiteral("window");
 | 
			
		||||
    Window::Anchors anchors = {Window::AnchorTop | Window::AnchorBottom | Window::AnchorLeft | Window::AnchorRight};
 | 
			
		||||
    int32_t exclusionZone = 0;
 | 
			
		||||
    bool keyboardInteractivity = true;
 | 
			
		||||
    Window::KeyboardInteractivity keyboardInteractivity = Window::KeyboardInteractivityExclusive;
 | 
			
		||||
    Window::Layer layer = Window::LayerTop;
 | 
			
		||||
    QMargins margins;
 | 
			
		||||
    QWaylandLayerSurface *getSurface() const;
 | 
			
		||||
| 
						 | 
				
			
			@ -76,15 +76,15 @@ QMargins Window::margins() const
 | 
			
		|||
    return d->margins;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Window::setKeyboardInteractivity(bool enabled)
 | 
			
		||||
void Window::setKeyboardInteractivity(KeyboardInteractivity interactivity)
 | 
			
		||||
{
 | 
			
		||||
    d->keyboardInteractivity = enabled;
 | 
			
		||||
    d->keyboardInteractivity = interactivity;
 | 
			
		||||
    if (auto surface = d->getSurface()) {
 | 
			
		||||
        surface->setKeyboardInteractivity(enabled);
 | 
			
		||||
        surface->setKeyboardInteractivity(interactivity);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool Window::keyboardInteractivity() const
 | 
			
		||||
Window::KeyboardInteractivity Window::keyboardInteractivity() const
 | 
			
		||||
{
 | 
			
		||||
    return d->keyboardInteractivity;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,6 +43,16 @@ public:
 | 
			
		|||
    };
 | 
			
		||||
    Q_ENUM(Layer)
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * This enum type is used to specify how the layer surface handles keyboard focus.
 | 
			
		||||
     */
 | 
			
		||||
    enum KeyboardInteractivity {
 | 
			
		||||
        KeyboardInteractivityNone = 0,
 | 
			
		||||
        KeyboardInteractivityExclusive = 1,
 | 
			
		||||
        KeyboardInteractivityOnDemand = 2,
 | 
			
		||||
    };
 | 
			
		||||
    Q_ENUM(KeyboardInteractivity)
 | 
			
		||||
 | 
			
		||||
    void setAnchors(Anchors anchor);
 | 
			
		||||
    Anchors anchors() const;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -52,8 +62,8 @@ public:
 | 
			
		|||
    void setMargins(const QMargins &margins);
 | 
			
		||||
    QMargins margins() const;
 | 
			
		||||
 | 
			
		||||
    void setKeyboardInteractivity(bool enabled);
 | 
			
		||||
    bool keyboardInteractivity() const;
 | 
			
		||||
    void setKeyboardInteractivity(KeyboardInteractivity interactivity);
 | 
			
		||||
    KeyboardInteractivity keyboardInteractivity() const;
 | 
			
		||||
 | 
			
		||||
    void setLayer(Layer layer);
 | 
			
		||||
    Layer layer() const;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue