diff --git a/src/src/ui/createTask/createtaskwidget.cpp b/src/src/ui/createTask/createtaskwidget.cpp index d3d5ab52..fead94fc 100644 --- a/src/src/ui/createTask/createtaskwidget.cpp +++ b/src/src/ui/createTask/createtaskwidget.cpp @@ -55,6 +55,8 @@ #include "aria2rpcinterface.h" #include "taskModel.h" +const int TEXT_URL_HEIGHT = 154; +const int TEXT_URL_HEIGHT_COMPACT = 173; CreateTaskWidget::CreateTaskWidget(QWidget *parent) : DDialog(parent) , m_analysisUrl(new AnalysisUrl) @@ -129,7 +131,7 @@ void CreateTaskWidget::initUi() } m_texturl->setPlaceholderText(tr("Enter download links or drag a torrent file here")); - m_texturl->setMinimumSize(QSize(500, 154)); + m_texturl->setMinimumWidth(500); m_texturl->setFont(font); m_texturl->setWordWrapMode(QTextOption::NoWrap); // m_texturl->document()->setMaximumBlockCount(60); @@ -161,18 +163,18 @@ void CreateTaskWidget::initUi() #ifdef DTKWIDGET_CLASS_DSizeMode if (DGuiApplicationHelper::instance()->sizeMode() == DGuiApplicationHelper::NormalMode) { m_tableView->verticalHeader()->setDefaultSectionSize(Global::tableView_NormalMode_Width); - m_texturl->setMinimumHeight(154); + m_texturl->setMinimumHeight(TEXT_URL_HEIGHT); } else { m_tableView->verticalHeader()->setDefaultSectionSize(Global::tableView_CompactMode_Width); - m_texturl->setMinimumHeight(184); + m_texturl->setMinimumHeight(TEXT_URL_HEIGHT_COMPACT); } connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, this, [=](DGuiApplicationHelper::SizeMode sizeMode) { if (sizeMode == DGuiApplicationHelper::NormalMode) { m_tableView->verticalHeader()->setDefaultSectionSize(Global::tableView_NormalMode_Width); - m_texturl->setMinimumHeight(154); + m_texturl->setMinimumHeight(TEXT_URL_HEIGHT); } else { m_tableView->verticalHeader()->setDefaultSectionSize(Global::tableView_CompactMode_Width); - m_texturl->setMinimumHeight(184); + m_texturl->setMinimumHeight(TEXT_URL_HEIGHT_COMPACT); } }); #else diff --git a/src/src/ui/mainFrame/mainframe.cpp b/src/src/ui/mainFrame/mainframe.cpp index 3474bbc3..bdaf7023 100644 --- a/src/src/ui/mainFrame/mainframe.cpp +++ b/src/src/ui/mainFrame/mainframe.cpp @@ -230,10 +230,10 @@ void MainFrame::init() itemsize.setHeight(40); m_LeftList->setItemSize(itemsize); } else { - font.setPixelSize(12); + font.setPixelSize(14); m_DownLoadingTableView->verticalHeader()->setDefaultSectionSize(Global::tableView_CompactMode_Width); m_RecycleTableView->verticalHeader()->setDefaultSectionSize(Global::tableView_CompactMode_Width); - itemsize.setHeight(40 * Global::compactMode_ratio); + itemsize.setHeight(40 - 4); m_LeftList->setItemSize(itemsize); } #else @@ -271,11 +271,11 @@ void MainFrame::init() itemsize.setHeight(40); m_LeftList->setItemSize(itemsize); } else { - font.setPixelSize(12); + font.setPixelSize(14); m_DownLoadingTableView->verticalHeader()->setDefaultSectionSize(Global::tableView_CompactMode_Width); m_RecycleTableView->verticalHeader()->setDefaultSectionSize(Global::tableView_CompactMode_Width); m_LeftList->setItemSize(QSize(Global::tableView_CompactMode_Width, Global::tableView_CompactMode_Width)); - itemsize.setHeight(40 * Global::compactMode_ratio); + itemsize.setHeight(40 - 4); m_LeftList->setItemSize(itemsize); } m_DownloadingItem->setFont(font);