mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-26 11:18:59 +00:00
PasswordInputDialog: Port to GML compilation
This commit is contained in:
parent
24157e4d1b
commit
ddbed25bb5
Notes:
sideshowbarker
2024-07-17 01:13:25 +09:00
Author: https://github.com/aryanbaburajan
Commit: ddbed25bb5
Pull-request: https://github.com/SerenityOS/serenity/pull/23782
Reviewed-by: https://github.com/timschumi ✅
5 changed files with 32 additions and 6 deletions
|
@ -6,7 +6,7 @@ stringify_gml(EmojiInputDialog.gml EmojiInputDialogGML.h emoji_input_dialog_gml)
|
||||||
stringify_gml(FontPickerDialog.gml FontPickerDialogGML.h font_picker_dialog_gml)
|
stringify_gml(FontPickerDialog.gml FontPickerDialogGML.h font_picker_dialog_gml)
|
||||||
stringify_gml(FilePickerDialog.gml FilePickerDialogGML.h file_picker_dialog_gml)
|
stringify_gml(FilePickerDialog.gml FilePickerDialogGML.h file_picker_dialog_gml)
|
||||||
stringify_gml(IncrementalSearchBanner.gml IncrementalSearchBannerGML.h incremental_search_banner_gml)
|
stringify_gml(IncrementalSearchBanner.gml IncrementalSearchBannerGML.h incremental_search_banner_gml)
|
||||||
stringify_gml(PasswordInputDialog.gml PasswordInputDialogGML.h password_input_dialog_gml)
|
compile_gml(PasswordInputDialog.gml PasswordInputDialogGML.cpp)
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
AboutDialog.cpp
|
AboutDialog.cpp
|
||||||
|
@ -92,6 +92,7 @@ set(SOURCES
|
||||||
OpacitySlider.cpp
|
OpacitySlider.cpp
|
||||||
Painter.cpp
|
Painter.cpp
|
||||||
PasswordInputDialog.cpp
|
PasswordInputDialog.cpp
|
||||||
|
PasswordInputDialogGML.cpp
|
||||||
PathBreadcrumbbar.cpp
|
PathBreadcrumbbar.cpp
|
||||||
PersistentModelIndex.cpp
|
PersistentModelIndex.cpp
|
||||||
Process.cpp
|
Process.cpp
|
||||||
|
@ -152,7 +153,6 @@ set(GENERATED_SOURCES
|
||||||
FilePickerDialogGML.h
|
FilePickerDialogGML.h
|
||||||
FontPickerDialogGML.h
|
FontPickerDialogGML.h
|
||||||
IncrementalSearchBannerGML.h
|
IncrementalSearchBannerGML.h
|
||||||
PasswordInputDialogGML.h
|
|
||||||
)
|
)
|
||||||
|
|
||||||
serenity_lib(LibGUI gui)
|
serenity_lib(LibGUI gui)
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <LibGUI/ImageWidget.h>
|
#include <LibGUI/ImageWidget.h>
|
||||||
#include <LibGUI/Label.h>
|
#include <LibGUI/Label.h>
|
||||||
#include <LibGUI/PasswordInputDialog.h>
|
#include <LibGUI/PasswordInputDialog.h>
|
||||||
#include <LibGUI/PasswordInputDialogGML.h>
|
#include <LibGUI/PasswordInputDialogWidget.h>
|
||||||
#include <LibGUI/TextBox.h>
|
#include <LibGUI/TextBox.h>
|
||||||
|
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
|
@ -23,8 +23,8 @@ PasswordInputDialog::PasswordInputDialog(Window* parent_window, ByteString title
|
||||||
resize(340, 122);
|
resize(340, 122);
|
||||||
set_title(move(title));
|
set_title(move(title));
|
||||||
|
|
||||||
auto widget = set_main_widget<Widget>();
|
auto widget = PasswordInputDialogWidget::try_create().release_value_but_fixme_should_propagate_errors();
|
||||||
widget->load_from_gml(password_input_dialog_gml).release_value_but_fixme_should_propagate_errors();
|
set_main_widget(widget);
|
||||||
|
|
||||||
auto& key_icon = *widget->find_descendant_of_type_named<GUI::ImageWidget>("key_icon");
|
auto& key_icon = *widget->find_descendant_of_type_named<GUI::ImageWidget>("key_icon");
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
@GUI::Widget {
|
@GUI::PasswordInputDialogWidget {
|
||||||
fill_with_background_color: true
|
fill_with_background_color: true
|
||||||
layout: @GUI::HorizontalBoxLayout {
|
layout: @GUI::HorizontalBoxLayout {
|
||||||
margins: [8]
|
margins: [8]
|
||||||
|
|
|
@ -15,6 +15,8 @@ class PasswordInputDialog : public Dialog {
|
||||||
C_OBJECT(PasswordInputDialog);
|
C_OBJECT(PasswordInputDialog);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
ErrorOr<NonnullRefPtr<GUI::Widget>> try_create();
|
||||||
|
|
||||||
virtual ~PasswordInputDialog() override = default;
|
virtual ~PasswordInputDialog() override = default;
|
||||||
|
|
||||||
static ExecResult show(Window* parent_window, ByteString& text_value, ByteString title, ByteString server, ByteString username);
|
static ExecResult show(Window* parent_window, ByteString& text_value, ByteString title, ByteString server, ByteString username);
|
||||||
|
|
24
Userland/Libraries/LibGUI/PasswordInputDialogWidget.h
Normal file
24
Userland/Libraries/LibGUI/PasswordInputDialogWidget.h
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2024, Aryan Baburajan <aryanbaburajan2007@gmail.com>.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <LibGUI/Frame.h>
|
||||||
|
|
||||||
|
namespace GUI {
|
||||||
|
|
||||||
|
class PasswordInputDialogWidget : public GUI::Widget {
|
||||||
|
C_OBJECT_ABSTRACT(PasswordInputDialogWidget)
|
||||||
|
|
||||||
|
public:
|
||||||
|
static ErrorOr<NonnullRefPtr<PasswordInputDialogWidget>> try_create();
|
||||||
|
virtual ~PasswordInputDialogWidget() override = default;
|
||||||
|
|
||||||
|
private:
|
||||||
|
PasswordInputDialogWidget() = default;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue