1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:17:35 +00:00

Calculator: Add support for copy+paste using system clipboard

This commit is contained in:
Brendan Coles 2021-02-24 14:35:39 +00:00 committed by Andreas Kling
parent 1ba1ca76d8
commit 9bc3c3c962
3 changed files with 29 additions and 1 deletions

View file

@ -147,6 +147,17 @@ void CalculatorWidget::add_digit_button(GUI::Button& button, int digit)
};
}
String CalculatorWidget::get_entry()
{
return m_entry->text();
}
void CalculatorWidget::set_entry(double value)
{
m_keypad.set_value(value);
update_display();
}
void CalculatorWidget::update_display()
{
m_entry->set_text(m_keypad.to_string());