mirror of
				https://gitee.com/spark-store-project/spark-store
				synced 2025-11-04 08:12:21 +08:00 
			
		
		
		
	优化 UI细节
This commit is contained in:
		
							parent
							
								
									f39890240f
								
							
						
					
					
						commit
						f9b8faa638
					
				@ -24,8 +24,8 @@ void image_show::setImage(QPixmap image)
 | 
			
		||||
//    QPainter painter(&screen0);
 | 
			
		||||
    QImage re_screen1;
 | 
			
		||||
    QImage re_screen0=screen0.scaled(QSize(400,300),Qt::KeepAspectRatio,Qt::SmoothTransformation);
 | 
			
		||||
    int desktop_w=DApplication::desktop()->width();
 | 
			
		||||
    int desktop_h=DApplication::desktop()->height();
 | 
			
		||||
    desktop_w=DApplication::desktop()->width();
 | 
			
		||||
    desktop_h=DApplication::desktop()->height();
 | 
			
		||||
    if(screen0.width()>(desktop_w-20) || screen0.height()>(desktop_h-20)){
 | 
			
		||||
         re_screen1=screen0.scaled(QSize(desktop_w-20,desktop_h-20),Qt::KeepAspectRatio,Qt::SmoothTransformation);
 | 
			
		||||
         m_image=QPixmap::fromImage(re_screen1);
 | 
			
		||||
@ -40,6 +40,8 @@ void image_show::mousePressEvent(QMouseEvent *)
 | 
			
		||||
{
 | 
			
		||||
   m_dialog->setimage(m_image);
 | 
			
		||||
   m_dialog->showFullScreen();
 | 
			
		||||
   moveToCenter(m_dialog);
 | 
			
		||||
   m_dialog->setFixedSize(desktop_w,desktop_h);
 | 
			
		||||
   m_dialog->move(0,0);/*
 | 
			
		||||
   moveToCenter(m_dialog);*/
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -16,6 +16,8 @@ public:
 | 
			
		||||
    explicit image_show(QWidget *parent = nullptr);
 | 
			
		||||
 | 
			
		||||
    void setImage(QPixmap);
 | 
			
		||||
    int desktop_w;
 | 
			
		||||
    int desktop_h;
 | 
			
		||||
private:
 | 
			
		||||
    QLabel *m_label=new QLabel;
 | 
			
		||||
    QPixmap m_image;
 | 
			
		||||
 | 
			
		||||
@ -111,7 +111,7 @@ Widget::~Widget()
 | 
			
		||||
void Widget::initUI()
 | 
			
		||||
{
 | 
			
		||||
    //ui初始化
 | 
			
		||||
    setMaskAlpha(230);
 | 
			
		||||
    setMaskAlpha(220);
 | 
			
		||||
    ui->webfoot->setFixedHeight(0);
 | 
			
		||||
    ui->stackedWidget->setCurrentIndex(0);
 | 
			
		||||
    ui->listWidget->hide();
 | 
			
		||||
@ -119,7 +119,7 @@ void Widget::initUI()
 | 
			
		||||
    ui->pushButton_uninstall->hide();
 | 
			
		||||
    ui->line1_widget->setStyleSheet("background-color:#808080");
 | 
			
		||||
    ui->icon->setPixmap(QIcon::fromTheme("spark-store").pixmap(36,36));
 | 
			
		||||
    ui->titlebar->setFixedHeight(48);
 | 
			
		||||
    ui->titlebar->setFixedHeight(50);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -134,7 +134,7 @@ void Widget::initUI()
 | 
			
		||||
    QWidget *w_titlebar=new QWidget;
 | 
			
		||||
    QHBoxLayout *ly_titlebar=new QHBoxLayout;
 | 
			
		||||
    w_titlebar->setLayout(ly_titlebar);
 | 
			
		||||
    ly_titlebar->addWidget(ui->pushButton_return);
 | 
			
		||||
//    ly_titlebar->addWidget(ui->pushButton_return);
 | 
			
		||||
    ly_titlebar->addStretch();
 | 
			
		||||
    ly_titlebar->addSpacing(50);
 | 
			
		||||
    ly_titlebar->addWidget(searchEdit);
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										233
									
								
								widget.ui
									
									
									
									
									
								
							
							
						
						
									
										233
									
								
								widget.ui
									
									
									
									
									
								
							@ -54,17 +54,49 @@
 | 
			
		||||
     <property name="styleSheet">
 | 
			
		||||
      <string notr="true"/>
 | 
			
		||||
     </property>
 | 
			
		||||
     <layout class="QVBoxLayout" name="verticalLayout_24">
 | 
			
		||||
      <property name="spacing">
 | 
			
		||||
       <number>2</number>
 | 
			
		||||
      </property>
 | 
			
		||||
     <layout class="QGridLayout" name="gridLayout_5">
 | 
			
		||||
      <property name="leftMargin">
 | 
			
		||||
       <number>5</number>
 | 
			
		||||
      </property>
 | 
			
		||||
      <property name="rightMargin">
 | 
			
		||||
       <number>5</number>
 | 
			
		||||
      </property>
 | 
			
		||||
      <item>
 | 
			
		||||
      <item row="6" column="0" colspan="5">
 | 
			
		||||
       <widget class="QPushButton" name="menu_video">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>视频播放</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="16" column="0" colspan="5">
 | 
			
		||||
       <widget class="QPushButton" name="menu_download">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>下载列表</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="12" column="0" colspan="5">
 | 
			
		||||
       <widget class="QPushButton" name="menu_system">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>系统工具</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="13" column="0" colspan="5">
 | 
			
		||||
       <widget class="QPushButton" name="menu_theme">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>主题美化</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="5" column="0" colspan="5">
 | 
			
		||||
       <widget class="QPushButton" name="menu_music">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>音乐欣赏</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="0" column="0" colspan="2">
 | 
			
		||||
       <widget class="QLabel" name="icon">
 | 
			
		||||
        <property name="minimumSize">
 | 
			
		||||
         <size>
 | 
			
		||||
@ -83,7 +115,7 @@
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
      <item row="1" column="0">
 | 
			
		||||
       <spacer name="verticalSpacer_7">
 | 
			
		||||
        <property name="orientation">
 | 
			
		||||
         <enum>Qt::Vertical</enum>
 | 
			
		||||
@ -99,7 +131,81 @@
 | 
			
		||||
        </property>
 | 
			
		||||
       </spacer>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
      <item row="0" column="4">
 | 
			
		||||
       <spacer name="horizontalSpacer_8">
 | 
			
		||||
        <property name="orientation">
 | 
			
		||||
         <enum>Qt::Horizontal</enum>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="sizeType">
 | 
			
		||||
         <enum>QSizePolicy::Fixed</enum>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="sizeHint" stdset="0">
 | 
			
		||||
         <size>
 | 
			
		||||
          <width>3</width>
 | 
			
		||||
          <height>20</height>
 | 
			
		||||
         </size>
 | 
			
		||||
        </property>
 | 
			
		||||
       </spacer>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="0" column="3">
 | 
			
		||||
       <widget class="QPushButton" name="pushButton_return">
 | 
			
		||||
        <property name="maximumSize">
 | 
			
		||||
         <size>
 | 
			
		||||
          <width>40</width>
 | 
			
		||||
          <height>16777215</height>
 | 
			
		||||
         </size>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string/>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="icon">
 | 
			
		||||
         <iconset resource="icons.qrc">
 | 
			
		||||
          <normaloff>:/icons/icons/category_active.svg</normaloff>:/icons/icons/category_active.svg</iconset>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="11" column="0" colspan="5">
 | 
			
		||||
       <widget class="QPushButton" name="menu_dev">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>编程开发</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="9" column="0" colspan="5">
 | 
			
		||||
       <widget class="QPushButton" name="menu_office">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>办公学习</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="17" column="0">
 | 
			
		||||
       <spacer name="verticalSpacer">
 | 
			
		||||
        <property name="orientation">
 | 
			
		||||
         <enum>Qt::Vertical</enum>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="sizeHint" stdset="0">
 | 
			
		||||
         <size>
 | 
			
		||||
          <width>20</width>
 | 
			
		||||
          <height>40</height>
 | 
			
		||||
         </size>
 | 
			
		||||
        </property>
 | 
			
		||||
       </spacer>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="10" column="0" colspan="5">
 | 
			
		||||
       <widget class="QPushButton" name="menu_read">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>阅读翻译</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="14" column="0" colspan="5">
 | 
			
		||||
       <widget class="QPushButton" name="menu_other">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>其他应用</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item row="2" column="0" colspan="5">
 | 
			
		||||
       <widget class="QPushButton" name="menu_main">
 | 
			
		||||
        <property name="styleSheet">
 | 
			
		||||
         <string notr="true"/>
 | 
			
		||||
@ -109,91 +215,35 @@
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
       <widget class="QPushButton" name="menu_network">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>网络应用</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
       <widget class="QPushButton" name="menu_chat">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>社交沟通</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
       <widget class="QPushButton" name="menu_music">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>音乐欣赏</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
       <widget class="QPushButton" name="menu_video">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>视频播放</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
      <item row="7" column="0" colspan="5">
 | 
			
		||||
       <widget class="QPushButton" name="menu_photo">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>图形图像</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
      <item row="8" column="0" colspan="5">
 | 
			
		||||
       <widget class="QPushButton" name="menu_game">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>游戏娱乐</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
       <widget class="QPushButton" name="menu_office">
 | 
			
		||||
      <item row="4" column="0" colspan="5">
 | 
			
		||||
       <widget class="QPushButton" name="menu_chat">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>办公学习</string>
 | 
			
		||||
         <string>社交沟通</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
       <widget class="QPushButton" name="menu_read">
 | 
			
		||||
      <item row="3" column="0" colspan="5">
 | 
			
		||||
       <widget class="QPushButton" name="menu_network">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>阅读翻译</string>
 | 
			
		||||
         <string>网络应用</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
       <widget class="QPushButton" name="menu_dev">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>编程开发</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
       <widget class="QPushButton" name="menu_system">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>系统工具</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
       <widget class="QPushButton" name="menu_theme">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>主题美化</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
       <widget class="QPushButton" name="menu_other">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>其他应用</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
      <item row="15" column="0" colspan="5">
 | 
			
		||||
       <widget class="QWidget" name="line1_widget" native="true">
 | 
			
		||||
        <property name="minimumSize">
 | 
			
		||||
         <size>
 | 
			
		||||
@ -212,22 +262,15 @@
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
       <widget class="QPushButton" name="menu_download">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>下载列表</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
       <spacer name="verticalSpacer">
 | 
			
		||||
      <item row="0" column="2">
 | 
			
		||||
       <spacer name="horizontalSpacer_9">
 | 
			
		||||
        <property name="orientation">
 | 
			
		||||
         <enum>Qt::Vertical</enum>
 | 
			
		||||
         <enum>Qt::Horizontal</enum>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="sizeHint" stdset="0">
 | 
			
		||||
         <size>
 | 
			
		||||
          <width>20</width>
 | 
			
		||||
          <height>40</height>
 | 
			
		||||
          <width>40</width>
 | 
			
		||||
          <height>20</height>
 | 
			
		||||
         </size>
 | 
			
		||||
        </property>
 | 
			
		||||
       </spacer>
 | 
			
		||||
@ -627,10 +670,13 @@
 | 
			
		||||
            <x>0</x>
 | 
			
		||||
            <y>0</y>
 | 
			
		||||
            <width>901</width>
 | 
			
		||||
            <height>864</height>
 | 
			
		||||
            <height>849</height>
 | 
			
		||||
           </rect>
 | 
			
		||||
          </property>
 | 
			
		||||
          <layout class="QVBoxLayout" name="verticalLayout_17">
 | 
			
		||||
           <property name="spacing">
 | 
			
		||||
            <number>0</number>
 | 
			
		||||
           </property>
 | 
			
		||||
           <item>
 | 
			
		||||
            <widget class="QWidget" name="widget_3" native="true">
 | 
			
		||||
             <property name="maximumSize">
 | 
			
		||||
@ -640,23 +686,6 @@
 | 
			
		||||
              </size>
 | 
			
		||||
             </property>
 | 
			
		||||
             <layout class="QGridLayout" name="gridLayout">
 | 
			
		||||
              <item row="0" column="0">
 | 
			
		||||
               <widget class="QPushButton" name="pushButton_return">
 | 
			
		||||
                <property name="maximumSize">
 | 
			
		||||
                 <size>
 | 
			
		||||
                  <width>40</width>
 | 
			
		||||
                  <height>16777215</height>
 | 
			
		||||
                 </size>
 | 
			
		||||
                </property>
 | 
			
		||||
                <property name="text">
 | 
			
		||||
                 <string/>
 | 
			
		||||
                </property>
 | 
			
		||||
                <property name="icon">
 | 
			
		||||
                 <iconset resource="icons.qrc">
 | 
			
		||||
                  <normaloff>:/icons/icons/category_active.svg</normaloff>:/icons/icons/category_active.svg</iconset>
 | 
			
		||||
                </property>
 | 
			
		||||
               </widget>
 | 
			
		||||
              </item>
 | 
			
		||||
              <item row="2" column="2">
 | 
			
		||||
               <spacer name="horizontalSpacer_2">
 | 
			
		||||
                <property name="orientation">
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user