Compare commits
7 commits
Author | SHA1 | Date | |
---|---|---|---|
|
6a06662bc2 | ||
|
a1eb8dae87 | ||
|
ffac420762 | ||
|
c43aed2fcd | ||
|
9f6a131f11 | ||
|
6879983f77 | ||
|
c3f7913cf4 |
8 changed files with 136 additions and 5 deletions
|
@ -2,6 +2,7 @@
|
|||
name = "iced_demo"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
|
22
LICENSE.md
Normal file
22
LICENSE.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2024 Imbus
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
24
makefile
24
makefile
|
@ -1,6 +1,8 @@
|
|||
PROJECT = $(shell basename $(CURDIR))
|
||||
GITHASH = $(shell git rev-parse --short HEAD)
|
||||
|
||||
PROJ_NAME = iced-demo
|
||||
|
||||
debug:
|
||||
cargo run
|
||||
|
||||
|
@ -26,3 +28,25 @@ sign: release source-release
|
|||
|
||||
publish: sign
|
||||
scp $(PROJECT)_$(GITHASH).tar.gz* $(PROJECT)_$(GITHASH)_source.tar.gz* server:/public/$(PROJECT)/
|
||||
|
||||
#cp packaging/$(PROJ_NAME).svg ~/.local/share/icons/
|
||||
install: release
|
||||
install -Dm755 target/release/$(PROJECT) ~/.local/bin/$(PROJ_NAME)
|
||||
cp packaging/$(PROJ_NAME).desktop ~/.local/share/applications/
|
||||
update-desktop-database ~/.local/share/applications/
|
||||
|
||||
uninstall:
|
||||
rm -f ~/.local/bin/$(PROJ_NAME)
|
||||
rm -f ~/.local/share/applications/$(PROJ_NAME).desktop
|
||||
rm -f ~/.local/share/icons/$(PROJ_NAME).svg
|
||||
update-desktop-database ~/.local/share/applications/
|
||||
|
||||
# Install the dependencies for building the RPM package
|
||||
rpm-deps:
|
||||
sudo dnf install rpmdevtools
|
||||
sudo dnf builddep packaging/$(PROJECT).spec
|
||||
|
||||
# This step requires the rpm-deps specified above
|
||||
rpm:
|
||||
spectool -g -R packaging/$(PROJECT).spec
|
||||
rpmbuild -bb packaging/$(PROJECT).spec
|
11
packaging/iced-demo.desktop
Normal file
11
packaging/iced-demo.desktop
Normal file
|
@ -0,0 +1,11 @@
|
|||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Iced Demo
|
||||
GenericName=Iced Demo
|
||||
Comment=Iced Demo is a simple demo application
|
||||
Categories=Utility
|
||||
Path=/home/imbus/.local/bin
|
||||
Exec=iced-demo
|
||||
Icon=/home/imbus/.local/share/icons/iced-demo.svg
|
||||
Terminal=false
|
||||
Keywords=demo
|
17
packaging/iced-demo.svg
Normal file
17
packaging/iced-demo.svg
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="-0.5 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||
|
||||
<title>desktop</title>
|
||||
<desc>Created with Sketch Beta.</desc>
|
||||
<defs>
|
||||
|
||||
</defs>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||
<g id="Icon-Set-Filled" sketch:type="MSLayerGroup" transform="translate(-570.000000, -465.000000)" fill="#000000">
|
||||
<path d="M597,465 L574,465 C571.791,465 570,466.791 570,469 L570,483 L601,483 L601,469 C601,466.791 599.209,465 597,465 L597,465 Z M570,487 C570,489.209 571.791,491 574,491 L597,491 C599.209,491 601,489.209 601,487 L601,485 L570,485 L570,487 L570,487 Z M592,495 L590,495 L590,493 L582,493 L582,495 L580,495 C579.447,495 579,495.448 579,496 C579,496.553 579.447,497 580,497 L592,497 C592.553,497 593,496.553 593,496 C593,495.448 592.553,495 592,495 L592,495 Z" id="desktop" sketch:type="MSShapeGroup">
|
||||
|
||||
</path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
55
packaging/iced_demo.spec
Normal file
55
packaging/iced_demo.spec
Normal file
|
@ -0,0 +1,55 @@
|
|||
# This spec is currently broken.
|
||||
|
||||
# Generated by rust2rpm 26
|
||||
%bcond_without check
|
||||
|
||||
# prevent library files from being installed
|
||||
%global cargo_install_lib 0
|
||||
|
||||
Name: iced_demo
|
||||
Version: 0.1.0
|
||||
Release: %autorelease
|
||||
Summary: A demo application using the Iced toolkit
|
||||
|
||||
SourceLicense: MIT
|
||||
# FIXME: paste output of %%cargo_license_summary here
|
||||
License: MIT
|
||||
# LICENSE.dependencies contains a full license breakdown
|
||||
|
||||
URL: https://git.silversoft.se/Imbus/iced_demo
|
||||
Source: %{url}/archive/%{version}.tar.gz
|
||||
|
||||
BuildRequires: cargo-rpm-macros >= 26
|
||||
|
||||
%global _description %{expand:
|
||||
%{summary}.}
|
||||
|
||||
%description %{_description}
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name} -p1
|
||||
%cargo_prep
|
||||
|
||||
%generate_buildrequires
|
||||
%cargo_generate_buildrequires
|
||||
|
||||
%build
|
||||
%cargo_build
|
||||
%{cargo_license_summary}
|
||||
%{cargo_license} > LICENSE.dependencies
|
||||
|
||||
%install
|
||||
%cargo_install
|
||||
|
||||
%if %{with check}
|
||||
%check
|
||||
%cargo_test
|
||||
%endif
|
||||
|
||||
%files
|
||||
%license LICENSE.md
|
||||
%license LICENSE.dependencies
|
||||
%{_bindir}/iced_demo
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
|
@ -26,7 +26,7 @@ pub fn main() -> iced::Result {
|
|||
width: 800.0,
|
||||
height: 600.0,
|
||||
},
|
||||
resizable: false,
|
||||
resizable: true,
|
||||
decorations: true,
|
||||
..window::Settings::default()
|
||||
},
|
||||
|
@ -70,6 +70,7 @@ impl Sandbox for Counter {
|
|||
match message {
|
||||
Message::InputChanged(value) => {
|
||||
self.input_val = value.clone();
|
||||
println!("InputChanged: {}", value);
|
||||
if let Ok(value) = value.parse::<i32>() {
|
||||
self.value = value;
|
||||
}
|
||||
|
@ -90,10 +91,9 @@ impl Sandbox for Counter {
|
|||
}
|
||||
]
|
||||
.width(Length::Fill)
|
||||
.padding([55, 0])
|
||||
.padding([0, 0])
|
||||
.align_items(Alignment::Center)
|
||||
.into()
|
||||
// row![TextInput::new("Search", &self.input_val).on_input(Message::InputChanged)].into()
|
||||
}
|
||||
|
||||
fn theme(&self) -> Theme {
|
||||
|
|
|
@ -11,6 +11,7 @@ use crate::{message::Message::*, Counter};
|
|||
pub fn search_bar(state: &Counter) -> Element<Message> {
|
||||
row![TextInput::new("Search", &state.input_val)
|
||||
.on_input(Message::InputChanged)
|
||||
.padding(Padding::from(15))
|
||||
.width(300)]
|
||||
.into()
|
||||
}
|
||||
|
@ -29,8 +30,8 @@ pub fn tabs(state: &Counter) -> Element<Message> {
|
|||
menu_tab_button("Settings", Tab::Settings),
|
||||
]
|
||||
.padding(10)
|
||||
.spacing(20)
|
||||
.width(300)
|
||||
// .spacing(20)
|
||||
.width(Length::Fixed(200f32))
|
||||
.height(Length::Shrink)
|
||||
.into()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue