mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Auto merge of #19798 - gootorov:move_cursor_from_mako, r=emilio
style: Move cursor property out of mako <!-- Please describe your changes on the following line: --> Sub-PR of #19015 r? emilio --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach build-geckolib` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #19775 (github issue number if applicable). <!-- Either: --> - [x] These changes do not require tests <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19798) <!-- Reviewable:end -->
This commit is contained in:
commit
59033e6970
17 changed files with 413 additions and 360 deletions
|
@ -29,7 +29,7 @@ use std::rc::Rc;
|
|||
use std::sync::mpsc::Sender;
|
||||
use std::time::{Duration, Instant};
|
||||
use style_traits::{CSSPixel, DevicePixel, PinchZoomFactor};
|
||||
use style_traits::cursor::Cursor;
|
||||
use style_traits::cursor::CursorKind;
|
||||
use style_traits::viewport::ViewportConstraints;
|
||||
use time::{precise_time_ns, precise_time_s};
|
||||
use touch::{TouchHandler, TouchAction};
|
||||
|
@ -771,7 +771,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
warn!("Sending event to constellation failed ({}).", e);
|
||||
}
|
||||
|
||||
if let Some(cursor) = Cursor::from_u8(item.tag.1 as _).ok() {
|
||||
if let Some(cursor) = CursorKind::from_u8(item.tag.1 as _).ok() {
|
||||
let msg = ConstellationMsg::SetCursor(cursor);
|
||||
if let Err(e) = self.constellation_chan.send(msg) {
|
||||
warn!("Sending event to constellation failed ({}).", e);
|
||||
|
|
|
@ -17,7 +17,7 @@ use script_traits::{AnimationState, ConstellationMsg, EventResult, LoadData};
|
|||
use servo_url::ServoUrl;
|
||||
use std::fmt::{Debug, Error, Formatter};
|
||||
use std::sync::mpsc::{Receiver, Sender};
|
||||
use style_traits::cursor::Cursor;
|
||||
use style_traits::cursor::CursorKind;
|
||||
use style_traits::viewport::ViewportConstraints;
|
||||
use webrender;
|
||||
use webrender_api;
|
||||
|
@ -133,7 +133,7 @@ pub enum EmbedderMsg {
|
|||
/// Sends an unconsumed key event back to the embedder.
|
||||
KeyEvent(Option<TopLevelBrowsingContextId>, Option<char>, Key, KeyState, KeyModifiers),
|
||||
/// Changes the cursor.
|
||||
SetCursor(Cursor),
|
||||
SetCursor(CursorKind),
|
||||
/// A favicon was detected
|
||||
NewFavicon(TopLevelBrowsingContextId, ServoUrl),
|
||||
/// <head> tag finished parsing
|
||||
|
|
|
@ -17,7 +17,7 @@ use servo_url::ServoUrl;
|
|||
use std::fmt::{Debug, Error, Formatter};
|
||||
use std::rc::Rc;
|
||||
use style_traits::DevicePixel;
|
||||
use style_traits::cursor::Cursor;
|
||||
use style_traits::cursor::CursorKind;
|
||||
use webrender_api::{DeviceUintSize, DeviceUintRect, ScrollLocation};
|
||||
|
||||
#[derive(Clone)]
|
||||
|
@ -173,7 +173,7 @@ pub trait WindowMethods {
|
|||
fn prepare_for_composite(&self, width: usize, height: usize) -> bool;
|
||||
|
||||
/// Sets the cursor to be used in the window.
|
||||
fn set_cursor(&self, cursor: Cursor);
|
||||
fn set_cursor(&self, cursor: CursorKind);
|
||||
|
||||
/// Process a key event.
|
||||
fn handle_key(&self, ctx: Option<TopLevelBrowsingContextId>, ch: Option<char>, key: Key, mods: KeyModifiers);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue