mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-11 17:00:37 +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: https://github.com/SerenityOS/serenity/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(FilePickerDialog.gml FilePickerDialogGML.h file_picker_dialog_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
|
||||
AboutDialog.cpp
|
||||
|
@ -92,6 +92,7 @@ set(SOURCES
|
|||
OpacitySlider.cpp
|
||||
Painter.cpp
|
||||
PasswordInputDialog.cpp
|
||||
PasswordInputDialogGML.cpp
|
||||
PathBreadcrumbbar.cpp
|
||||
PersistentModelIndex.cpp
|
||||
Process.cpp
|
||||
|
@ -152,7 +153,6 @@ set(GENERATED_SOURCES
|
|||
FilePickerDialogGML.h
|
||||
FontPickerDialogGML.h
|
||||
IncrementalSearchBannerGML.h
|
||||
PasswordInputDialogGML.h
|
||||
)
|
||||
|
||||
serenity_lib(LibGUI gui)
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <LibGUI/ImageWidget.h>
|
||||
#include <LibGUI/Label.h>
|
||||
#include <LibGUI/PasswordInputDialog.h>
|
||||
#include <LibGUI/PasswordInputDialogGML.h>
|
||||
#include <LibGUI/PasswordInputDialogWidget.h>
|
||||
#include <LibGUI/TextBox.h>
|
||||
|
||||
namespace GUI {
|
||||
|
@ -23,8 +23,8 @@ PasswordInputDialog::PasswordInputDialog(Window* parent_window, ByteString title
|
|||
resize(340, 122);
|
||||
set_title(move(title));
|
||||
|
||||
auto widget = set_main_widget<Widget>();
|
||||
widget->load_from_gml(password_input_dialog_gml).release_value_but_fixme_should_propagate_errors();
|
||||
auto widget = PasswordInputDialogWidget::try_create().release_value_but_fixme_should_propagate_errors();
|
||||
set_main_widget(widget);
|
||||
|
||||
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
|
||||
layout: @GUI::HorizontalBoxLayout {
|
||||
margins: [8]
|
||||
|
|
|
@ -15,6 +15,8 @@ class PasswordInputDialog : public Dialog {
|
|||
C_OBJECT(PasswordInputDialog);
|
||||
|
||||
public:
|
||||
ErrorOr<NonnullRefPtr<GUI::Widget>> try_create();
|
||||
|
||||
virtual ~PasswordInputDialog() override = default;
|
||||
|
||||
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…
Reference in a new issue