ENH:Optimization of File Transfer System Part2

jira: [STUDIO-11777]

Change-Id: I12744db7d2e3b53425454d632533768c54524677
(cherry picked from commit 4358e9ce351c5784e392a75d1ffcf2f54e1916ec)
This commit is contained in:
milk
2025-04-27 15:30:43 +08:00
committed by Noisyfox
parent 7f471d59a5
commit 9a542b1a0f
10 changed files with 263 additions and 97 deletions

View File

@@ -15,7 +15,7 @@ ProgressBar::ProgressBar(wxWindow *parent, wxWindowID id, int max, const wxPoint
{
m_shownumber = shown;
SetBackgroundColour(wxColour(255,255,255));
if (size.y >= miniHeight) {
m_miniHeight = size.y;
} else {
@@ -64,20 +64,20 @@ void ProgressBar::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, w
}
void ProgressBar::SetRadius(double radius) {
void ProgressBar::SetRadius(double radius) {
m_radius = radius;
Refresh();
}
void ProgressBar::SetProgressForedColour(wxColour colour)
void ProgressBar::SetProgressForedColour(wxColour colour)
{
m_progress_background_colour = colour;
Refresh();
}
void ProgressBar::SetProgressBackgroundColour(wxColour colour)
{
m_progress_colour = colour;
void ProgressBar::SetProgressBackgroundColour(wxColour colour)
{
m_progress_colour = colour;
Refresh();
}
@@ -86,29 +86,29 @@ void ProgressBar::Rescale()
;
}
void ProgressBar::ShowNumber(bool shown)
void ProgressBar::ShowNumber(bool shown)
{
m_shownumber = shown;
Refresh();
}
void ProgressBar::Disable(wxString text)
{
void ProgressBar::Disable(wxString text)
{
if (m_disable) return;
m_disable_text = text;
m_disable = true;
Refresh();
}
void ProgressBar::SetValue(int step)
{
void ProgressBar::SetValue(int step)
{
m_disable = false;
SetProgress(step);
}
void ProgressBar::Reset()
{
m_step = 0;
void ProgressBar::Reset()
{
m_step = 0;
SetValue(0);
}
@@ -126,9 +126,9 @@ void ProgressBar::SetProgress(int step)
}
void ProgressBar::SetMinSize(const wxSize &size)
{
if (size.y >= miniHeight) {
void ProgressBar::SetMinSize(const wxSize &size)
{
if (size.y >= miniHeight) {
m_miniHeight = size.y;
} else {
return;
@@ -181,7 +181,7 @@ void ProgressBar::doRender(wxDC &dc)
dc.DrawRoundedRectangle(0, 0, size.x, size.y, m_radius);
}
//draw progress
//draw progress
if (m_disable) {
m_proportion = float(size.x * float(this->m_step) / float(this->m_max));
if (m_proportion < m_radius * 2 && m_proportion != 0) { m_proportion = m_radius * 2; }
@@ -232,11 +232,11 @@ void ProgressBar::doRender(wxDC &dc)
dc.DrawText(text + wxString("%"), pt);
}
}
}
void ProgressBar::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
void ProgressBar::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
wxWindow::DoSetSize(x, y, width, height, sizeFlags);
}