update
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run
Rust / build (macos-latest, stable) (pull_request) Waiting to run
Rust / build (ubuntu-latest, stable) (pull_request) Waiting to run
Rust / build (windows-latest, stable) (pull_request) Waiting to run
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run
Rust / build (macos-latest, stable) (pull_request) Waiting to run
Rust / build (ubuntu-latest, stable) (pull_request) Waiting to run
Rust / build (windows-latest, stable) (pull_request) Waiting to run
This commit is contained in:
@@ -8,13 +8,12 @@ use signed_core::Announcement;
|
||||
use ui::avatar::Avatar;
|
||||
use ui::clipboard::ClipboardButton;
|
||||
use ui::common::{Sizable as _, h_flex, v_flex};
|
||||
use ui::dialog::Dialog;
|
||||
use ui::dialog::{Dialog, DialogHandle};
|
||||
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use utils::middle_truncate;
|
||||
|
||||
use crate::shared::dialogs::{close_global, open_global};
|
||||
|
||||
pub struct AboutDialog {
|
||||
handle: DialogHandle,
|
||||
announcement: Announcement,
|
||||
directory: Entity<ProfileDirectory>,
|
||||
}
|
||||
@@ -26,6 +25,7 @@ impl AboutDialog {
|
||||
cx: &mut App,
|
||||
) -> Entity<Self> {
|
||||
cx.new(|_| Self {
|
||||
handle: DialogHandle::new(true),
|
||||
announcement,
|
||||
directory,
|
||||
})
|
||||
@@ -38,13 +38,8 @@ impl Render for AboutDialog {
|
||||
let directory = self.directory.clone();
|
||||
|
||||
Dialog::new("about-dialog")
|
||||
.open(true)
|
||||
.handle(self.handle.clone())
|
||||
.min_width(px(500.))
|
||||
.on_change(|open, _, cx| {
|
||||
if !open {
|
||||
close_global(cx);
|
||||
}
|
||||
})
|
||||
.title("About")
|
||||
.content(move |_, cx| announcement_rows(&announcement, &directory, cx))
|
||||
.into_any_element()
|
||||
@@ -259,8 +254,3 @@ fn list(id: &'static str, items: impl IntoIterator<Item = String>, cx: &App) ->
|
||||
}))
|
||||
.into_any_element()
|
||||
}
|
||||
|
||||
/// Opens the read-only repository metadata dialog.
|
||||
pub fn open(announcement: Announcement, directory: Entity<ProfileDirectory>, cx: &mut App) {
|
||||
open_global(AboutDialog::new(announcement, directory, cx), cx);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user