widgets: Rename Window* to *Window
This commit is contained in:
parent
4b0d5f7b6d
commit
f5660ba83e
9 changed files with 41 additions and 41 deletions
|
|
@ -22,17 +22,17 @@ use adw::{glib, gtk};
|
|||
mod imp {
|
||||
use super::*;
|
||||
#[derive(Debug, Default, gtk::CompositeTemplate, glib::Properties)]
|
||||
#[properties(wrapper_type = super::LpWindowEdit)]
|
||||
#[template(file = "window_edit.ui")]
|
||||
pub struct LpWindowEdit {
|
||||
#[properties(wrapper_type = super::LpImageEdit)]
|
||||
#[template(file = "edit_window.ui")]
|
||||
pub struct LpImageEdit {
|
||||
#[property(get)]
|
||||
example: u64,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
impl ObjectSubclass for LpWindowEdit {
|
||||
const NAME: &'static str = "LpWindowEdit";
|
||||
type Type = super::LpWindowEdit;
|
||||
impl ObjectSubclass for LpImageEdit {
|
||||
const NAME: &'static str = "LpImageEdit";
|
||||
type Type = super::LpImageEdit;
|
||||
type ParentType = adw::Bin;
|
||||
|
||||
fn class_init(klass: &mut Self::Class) {
|
||||
|
|
@ -45,22 +45,22 @@ mod imp {
|
|||
}
|
||||
|
||||
#[glib::derived_properties]
|
||||
impl ObjectImpl for LpWindowEdit {
|
||||
impl ObjectImpl for LpImageEdit {
|
||||
fn constructed(&self) {
|
||||
self.parent_constructed();
|
||||
}
|
||||
}
|
||||
|
||||
impl WidgetImpl for LpWindowEdit {}
|
||||
impl BinImpl for LpWindowEdit {}
|
||||
impl WidgetImpl for LpImageEdit {}
|
||||
impl BinImpl for LpImageEdit {}
|
||||
}
|
||||
|
||||
glib::wrapper! {
|
||||
pub struct LpWindowEdit(ObjectSubclass<imp::LpWindowEdit>)
|
||||
pub struct LpImageEdit(ObjectSubclass<imp::LpImageEdit>)
|
||||
@extends gtk::Widget, adw::Bin;
|
||||
}
|
||||
|
||||
impl LpWindowEdit {
|
||||
impl LpImageEdit {
|
||||
pub fn new() -> Self {
|
||||
glib::Object::new()
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="LpWindowEdit" parent="AdwBin">
|
||||
<template class="LpImageEdit" parent="AdwBin">
|
||||
<property name="child">
|
||||
<object class="AdwToolbarView" id="toolbar_view">
|
||||
<child type="top">
|
||||
|
|
@ -57,9 +57,9 @@ mod imp {
|
|||
|
||||
use super::*;
|
||||
#[derive(Debug, Default, gtk::CompositeTemplate, glib::Properties)]
|
||||
#[properties(wrapper_type = super::LpWindowImage)]
|
||||
#[template(file = "window_image.ui")]
|
||||
pub struct LpWindowImage {
|
||||
#[properties(wrapper_type = super::LpImageWindow)]
|
||||
#[template(file = "image_window.ui")]
|
||||
pub struct LpImageWindow {
|
||||
#[property(get, construct_only)]
|
||||
window: OnceCell<LpWindow>,
|
||||
|
||||
|
|
@ -114,9 +114,9 @@ mod imp {
|
|||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
impl ObjectSubclass for LpWindowImage {
|
||||
const NAME: &'static str = "LpWindowImage";
|
||||
type Type = super::LpWindowImage;
|
||||
impl ObjectSubclass for LpImageWindow {
|
||||
const NAME: &'static str = "LpImageWindow";
|
||||
type Type = super::LpImageWindow;
|
||||
type ParentType = adw::Bin;
|
||||
|
||||
fn instance_init(obj: &glib::subclass::InitializingObject<Self>) {
|
||||
|
|
@ -152,7 +152,7 @@ mod imp {
|
|||
}
|
||||
|
||||
#[glib::derived_properties]
|
||||
impl ObjectImpl for LpWindowImage {
|
||||
impl ObjectImpl for LpImageWindow {
|
||||
fn constructed(&self) {
|
||||
self.parent_constructed();
|
||||
|
||||
|
|
@ -419,10 +419,10 @@ mod imp {
|
|||
}
|
||||
}
|
||||
|
||||
impl WidgetImpl for LpWindowImage {}
|
||||
impl BinImpl for LpWindowImage {}
|
||||
impl WidgetImpl for LpImageWindow {}
|
||||
impl BinImpl for LpImageWindow {}
|
||||
|
||||
impl LpWindowImage {
|
||||
impl LpImageWindow {
|
||||
fn is_showing_image(&self) -> bool {
|
||||
self.image_view.try_get().map_or(false, |image_view| {
|
||||
image_view
|
||||
|
|
@ -434,11 +434,11 @@ mod imp {
|
|||
}
|
||||
|
||||
glib::wrapper! {
|
||||
pub struct LpWindowImage(ObjectSubclass<imp::LpWindowImage>)
|
||||
pub struct LpImageWindow(ObjectSubclass<imp::LpImageWindow>)
|
||||
@extends gtk::Widget, adw::Bin;
|
||||
}
|
||||
|
||||
impl LpWindowImage {
|
||||
impl LpImageWindow {
|
||||
fn zoom_out_cursor(&self) {
|
||||
if let Some(image) = self.imp().image_view.current_image() {
|
||||
image.zoom_out_cursor();
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
<template class="LpWindowImage" parent="AdwBin">
|
||||
<template class="LpImageWindow" parent="AdwBin">
|
||||
<property name="child">
|
||||
<object class="AdwMultiLayoutView" id="multi_layout_view">
|
||||
<child>
|
||||
|
|
@ -79,7 +79,7 @@ impl ActionPartGlobal {
|
|||
}
|
||||
|
||||
pub fn init_actions_and_bindings(
|
||||
klass: &mut <super::imp::LpWindowImage as ObjectSubclass>::Class,
|
||||
klass: &mut <super::imp::LpImageWindow as ObjectSubclass>::Class,
|
||||
) {
|
||||
for action in Self::iter() {
|
||||
match action {
|
||||
|
|
@ -206,7 +206,7 @@ pub enum Action {
|
|||
|
||||
impl Action {
|
||||
pub fn init_actions_and_bindings(
|
||||
klass: &mut <super::imp::LpWindowImage as ObjectSubclass>::Class,
|
||||
klass: &mut <super::imp::LpImageWindow as ObjectSubclass>::Class,
|
||||
) {
|
||||
for action in Self::iter() {
|
||||
match action {
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
use super::*;
|
||||
|
||||
/// Manage visibility of overlay controls
|
||||
impl LpWindowImage {
|
||||
impl LpImageWindow {
|
||||
/// Set control opacity
|
||||
///
|
||||
/// Also changes headerbar transparency if it flat and hides/shows cursor on
|
||||
Loading…
Add table
Add a link
Reference in a new issue