Skip to content

Commit 8aac541

Browse files
committed
优化
1 parent 8b26cdc commit 8aac541

File tree

10 files changed

+428
-97
lines changed

10 files changed

+428
-97
lines changed

Installer/Tinypng-Windows.exe

10.3 KB
Binary file not shown.

Installer/Tinypng-Windows.zip

7.7 MB
Binary file not shown.

assets/Screenshot1.png

11.2 KB
Loading

assets/Screenshot2.png

20.1 KB
Loading

assets/Screenshot3.png

7.44 KB
Loading

tinypng/MainWindow.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ MainWindow::MainWindow(QWidget* parent) :
2020
QMainWindow(parent)
2121
{
2222

23+
QFont font("NSimSun");
24+
font.setPixelSize(12);
25+
QApplication::setFont(font);
26+
2327
layout = new QVBoxLayout();
2428
_buildTopBtns();
2529
_buildBody();
@@ -31,6 +35,8 @@ MainWindow::MainWindow(QWidget* parent) :
3135
QGuiApplication::setWindowIcon(icon);
3236
setWindowTitle("图片压缩");
3337

38+
39+
3440
QThread* dispatcherThread = new QThread();
3541

3642
dispatcher = new Dispatcher(dispatcherThread, this->console, this->table);
@@ -59,6 +65,7 @@ void MainWindow::_buildTopBtns() {
5965
startbtn = new QPushButton(QString("开始压缩(S)"), this);
6066
startbtn->setFixedSize(100, 45);
6167
startbtn->setIcon(QIcon(":/res/icons/compress.png"));
68+
6269
startbtn->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S));
6370

6471
pausebtn = new QPushButton(QString("暂停压缩(P)"), this);
@@ -68,6 +75,8 @@ void MainWindow::_buildTopBtns() {
6875
pausebtn->hide();
6976

7077

78+
79+
7180
QPushButton* config = new QPushButton(QString("配置KEY(C)"), this);
7281
config->setFixedSize(100, 45);
7382
config->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_C));

tinypng/MyTableView.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ MyTableView::MyTableView(QWidget* parent, QAbstractItemModel* model) :QTableView
2121
this->setGridHeaderview();
2222
overlay = new MyOverlay(this);
2323

24+
25+
26+
2427
}
2528

2629
void MyTableView::init() {
@@ -54,6 +57,8 @@ selection-color: white \
5457
setColumnWidth(3, 100);
5558
setColumnWidth(2, 100);
5659
setColumnWidth(1, 100);
60+
setColumnWidth(0, this->width() - 400);
61+
5762
//setFocusPolicy(Qt::NoFocus);
5863
horizontalHeader()->setHighlightSections(true);
5964
setEditTriggers(QAbstractItemView::NoEditTriggers);
@@ -171,7 +176,7 @@ void MyTableView::setGridHeaderview() {
171176
GridTableHeaderView* header;
172177

173178
header =
174-
new GridTableHeaderView(Qt::Horizontal, 2, model()->columnCount());
179+
new GridTableHeaderView(Qt::Horizontal, 2, model()->columnCount(), this);
175180
setHorizontalHeader(header);
176181

177182

@@ -262,7 +267,7 @@ bool MyTableView::checkMimeIsDir(const QMimeData* mimedata) {
262267
}
263268
void MyTableView::resizeEvent(QResizeEvent* event) {
264269
QTableView::resizeEvent(event);
265-
this->setColumnWidth(0, event->size().width() - 400);
270+
setColumnWidth(0, event->size().width() - 400);
266271

267272
QPoint pos = this->mapTo(this, QPoint(0, 0));
268273
overlay->setGeometry(pos.x(), pos.y(), this->width(), this->height());

tinypng/VsTinypng.pro.user

Lines changed: 75 additions & 95 deletions
Large diffs are not rendered by default.

tinypng/VsTinypng.pro.user.c82be32.4.10-pre1

Lines changed: 336 additions & 0 deletions
Large diffs are not rendered by default.

tinypng/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ int main(int argc, char* argv[])
1212
}
1313

1414

15+
1516
QTranslator qtTranslator;
1617

1718
QTranslator* pTranslator = new QTranslator();

0 commit comments

Comments
 (0)