mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-02-25 00:59:55 -05:00
init
This commit is contained in:
parent
a398ed1634
commit
7fa6eb3720
@ -298,7 +298,7 @@ void RandomPasswordView::new_password() {
|
|||||||
text_generated_passwd.set(password);
|
text_generated_passwd.set(password);
|
||||||
text_char_type_hints.set(char_type_hints);
|
text_char_type_hints.set(char_type_hints);
|
||||||
|
|
||||||
paint_password_hints(); // TODO: why flash and disappeared
|
paint_password_hints();
|
||||||
|
|
||||||
if (logger && logging) {
|
if (logger && logging) {
|
||||||
str_log += generate_log_line();
|
str_log += generate_log_line();
|
||||||
@ -309,7 +309,7 @@ void RandomPasswordView::new_password() {
|
|||||||
if (check_auto_send.value() || flooding) {
|
if (check_auto_send.value() || flooding) {
|
||||||
async_prev_val = portapack::async_tx_enabled;
|
async_prev_val = portapack::async_tx_enabled;
|
||||||
portapack::async_tx_enabled = true;
|
portapack::async_tx_enabled = true;
|
||||||
// printing out seeds buufer
|
// printing out seeds buffer
|
||||||
// for (auto seed : seeds_deque) {
|
// for (auto seed : seeds_deque) {
|
||||||
// UsbSerialAsyncmsg::asyncmsg(std::to_string(seed));
|
// UsbSerialAsyncmsg::asyncmsg(std::to_string(seed));
|
||||||
// }
|
// }
|
||||||
@ -320,18 +320,11 @@ void RandomPasswordView::new_password() {
|
|||||||
clean_buffer();
|
clean_buffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
// tried:
|
|
||||||
// 1. paint inline in new_password func
|
|
||||||
// 2. paint in a seperate func and call from new_password
|
|
||||||
// 3. override nav's paint func (i think it can tried to capture same obj) and paint, hoping set_dirty handle it correctly
|
|
||||||
// 4. override nav's paint func (i think it can tried to capture same obj) and paint in a seperate func, hoping set_dirty handle it correctly
|
|
||||||
// all these methods failed, and all of them only flash and disappeared. only when set_dirty in on_data (which seems incorrect), and it keep flashing never stop. but see painted content (flashing too)
|
|
||||||
// btw this is not caused by the seed text set thing, cuz commented it out not helping.
|
|
||||||
void RandomPasswordView::paint_password_hints() {
|
void RandomPasswordView::paint_password_hints() {
|
||||||
Painter painter;
|
Painter painter;
|
||||||
const int char_width = 8;
|
const int char_width = 8;
|
||||||
const int char_height = 16;
|
const int char_height = 16;
|
||||||
const int start_y = 7 * char_height + 5;
|
const int start_y = 6 * char_height;
|
||||||
const int rect_height = 4;
|
const int rect_height = 4;
|
||||||
|
|
||||||
for (size_t i = 0; i < password.length(); i++) {
|
for (size_t i = 0; i < password.length(); i++) {
|
||||||
|
@ -45,7 +45,7 @@ using namespace ui;
|
|||||||
|
|
||||||
namespace ui::external_app::random_password {
|
namespace ui::external_app::random_password {
|
||||||
|
|
||||||
class RandomPasswordLogger { // TODO: log is broken after introduced the buffer thing
|
class RandomPasswordLogger {
|
||||||
public:
|
public:
|
||||||
Optional<File::Error> append(const std::filesystem::path& filename) {
|
Optional<File::Error> append(const std::filesystem::path& filename) {
|
||||||
return log_file.append(filename);
|
return log_file.append(filename);
|
||||||
@ -126,7 +126,7 @@ class RandomPasswordView : public View {
|
|||||||
"000000000000000000000000000000"};
|
"000000000000000000000000000000"};
|
||||||
|
|
||||||
Text text_char_type_hints{
|
Text text_char_type_hints{
|
||||||
{0, 5 * 16, screen_width, 16},
|
{0, 5 * 16 + 4, screen_width, 16},
|
||||||
"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"};
|
"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"};
|
||||||
|
|
||||||
Checkbox check_show_seeds{
|
Checkbox check_show_seeds{
|
||||||
|
@ -156,6 +156,8 @@ class Widget {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class View : public Widget {
|
class View : public Widget {
|
||||||
|
// unlike Paint class, our Y ignored the top bar;
|
||||||
|
// so when you draw some of us as Y = 0, it would be exact below the top bar, instead of overlapped with top bar
|
||||||
public:
|
public:
|
||||||
View() {
|
View() {
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user