diff options
author | 2024-03-18 19:15:25 +0100 | |
---|---|---|
committer | 2024-03-18 19:15:25 +0100 | |
commit | f409037c0766016a9bd22abde5da14406e74959a (patch) | |
tree | 350205feb0273fc6b73da66c4cae47030aec1dcb /src | |
parent | e8483f0f0ba5d7883476f4f96c66e953f941a823 (diff) | |
download | iced-f409037c0766016a9bd22abde5da14406e74959a.tar.gz iced-f409037c0766016a9bd22abde5da14406e74959a.tar.bz2 iced-f409037c0766016a9bd22abde5da14406e74959a.zip |
Simplify message names in overview docs
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -63,8 +63,8 @@ //! ``` //! #[derive(Debug, Clone, Copy)] //! pub enum Message { -//! IncrementPressed, -//! DecrementPressed, +//! Increment, +//! Decrement, //! } //! ``` //! @@ -79,8 +79,8 @@ //! # //! # #[derive(Debug, Clone, Copy)] //! # pub enum Message { -//! # IncrementPressed, -//! # DecrementPressed, +//! # Increment, +//! # Decrement, //! # } //! # //! use iced::widget::{button, column, text, Column}; @@ -90,15 +90,15 @@ //! // We use a column: a simple vertical layout //! column![ //! // The increment button. We tell it to produce an -//! // `IncrementPressed` message when pressed -//! button("+").on_press(Message::IncrementPressed), +//! // `Increment` message when pressed +//! button("+").on_press(Message::Increment), //! //! // We show the value of the counter here //! text(self.value).size(50), //! //! // The decrement button. We tell it to produce a -//! // `DecrementPressed` message when pressed -//! button("-").on_press(Message::DecrementPressed), +//! // `Decrement` message when pressed +//! button("-").on_press(Message::Decrement), //! ] //! } //! } @@ -115,18 +115,18 @@ //! # //! # #[derive(Debug, Clone, Copy)] //! # pub enum Message { -//! # IncrementPressed, -//! # DecrementPressed, +//! # Increment, +//! # Decrement, //! # } //! impl Counter { //! // ... //! //! pub fn update(&mut self, message: Message) { //! match message { -//! Message::IncrementPressed => { +//! Message::Increment => { //! self.value += 1; //! } -//! Message::DecrementPressed => { +//! Message::Decrement => { //! self.value -= 1; //! } //! } |