pull/62/head
parent dae297759e
commit 69906a77cd

@ -123,7 +123,7 @@ void on_application_chooser_open(GtkWidget *self, main_window *widgets){
}
void on_user_changed(GtkWidget *self, main_window *widgets){
GtkAdjustment *adj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(widgets->prioritySpin));
GtkAdjustment *adj = gtk_range_get_adjustment(GTK_RANGE(widgets->priorityScale));
if (gtk_combo_box_get_active(GTK_COMBO_BOX(self))==0){
gtk_adjustment_set_lower(adj,-20);
gtk_label_set_text(GTK_LABEL(widgets->highestPriorityLabel),PRIORITY_ROOT_LABEL);
@ -151,7 +151,7 @@ void on_user_activate(GtkToggleButton *self, main_window *widgets){
}
void on_user_switching(GtkToggleButton *self, main_window *widgets){
GtkAdjustment *adj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(widgets->prioritySpin));
GtkAdjustment *adj = gtk_range_get_adjustment(GTK_RANGE(widgets->priorityScale));
if (gtk_toggle_button_get_active(self)){
if (!gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->runWithUserCombo))){
gtk_adjustment_set_lower(adj,-20);
@ -180,7 +180,7 @@ void on_setup_command(GtkWidget *self, main_window *widgets){
int su_check = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->runWithUserSuCheck));
int sudo_check = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->runWithUserSudoCheck));
int priority_check = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->priorityCheck));
char *priority = priority_check ? yon_char_append(" --priority=",yon_char_from_long(gtk_spin_button_get_value(GTK_SPIN_BUTTON(widgets->prioritySpin)))) : "";
char *priority = priority_check ? yon_char_append(" --priority=",yon_char_from_long(gtk_adjustment_get_value(gtk_range_get_adjustment(GTK_RANGE(widgets->priorityScale))))) : "";
int size;
char *command = yon_char_unite(get_run_command_command, " -o",
terminal_check ? yon_char_append(" --terminal=", terminal->name_simple) : "",
@ -219,7 +219,7 @@ void on_command_run(GtkWidget *self, main_window *widgets){
int su_check = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->runWithUserSuCheck));
int sudo_check = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->runWithUserSudoCheck));
int priority_check = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->priorityCheck));
char *priority = priority_check ? yon_char_append(" --priority=",yon_char_from_long(gtk_spin_button_get_value(GTK_SPIN_BUTTON(widgets->prioritySpin)))) : "";
char *priority = priority_check ? yon_char_append(" --priority=",yon_char_from_long(gtk_adjustment_get_value(gtk_range_get_adjustment(GTK_RANGE(widgets->priorityScale))))) : "";
int size;
char *command = yon_char_unite(get_run_command_command,
terminal_check ? yon_char_append(" --terminal=", terminal->name_simple) : "",
@ -254,6 +254,22 @@ void config_init(){
main_config.lock_save_local=0;
}
void on_adjustment_changed(GtkAdjustment *self, main_window *widgets){
gtk_entry_set_text(GTK_ENTRY(widgets->prioritySpinEntry),yon_char_from_long(gtk_adjustment_get_value(self)));
}
void on_adjustment_increase(GtkWidget *self, main_window *widgets) {
long current = gtk_adjustment_get_value(gtk_range_get_adjustment(GTK_RANGE(widgets->priorityScale)));
current ++;
gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(widgets->priorityScale)),current);
}
void on_adjustment_decrease(GtkWidget *self, main_window *widgets) {
long current = gtk_adjustment_get_value(gtk_range_get_adjustment(GTK_RANGE(widgets->priorityScale)));
current --;
gtk_adjustment_set_value(gtk_range_get_adjustment(GTK_RANGE(widgets->priorityScale)),current);
}
main_window *setup_window(){
/* Widgets getting | Получение виджетов */
main_window *widgets = malloc(sizeof(main_window));
@ -279,7 +295,9 @@ main_window *setup_window(){
widgets->priorityCheck = yon_gtk_builder_get_widget(builder,"priorityCheck");
widgets->priorityScale = yon_gtk_builder_get_widget(builder,"priorityScale");
widgets->prioritySpin = yon_gtk_builder_get_widget(builder,"prioritySpin");
widgets->prioritySpinEntry = yon_gtk_builder_get_widget(builder,"prioritySpinEntry");
widgets->prioritySpinIncreaseButton = yon_gtk_builder_get_widget(builder,"prioritySpinIncreaseButton");
widgets->prioritySpinDecreaseButton = yon_gtk_builder_get_widget(builder,"prioritySpinDecreaseButton");
widgets->highestPriorityLabel = yon_gtk_builder_get_widget(builder,"highestPriorityLabel");
widgets->commandCheck = yon_gtk_builder_get_widget(builder,"commandCheck");
@ -311,7 +329,7 @@ main_window *setup_window(){
g_signal_connect(G_OBJECT(widgets->chooseDesktopButton),"clicked",G_CALLBACK(on_application_chooser_open),widgets);
g_signal_connect(G_OBJECT(widgets->priorityCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->priorityScale);
g_signal_connect(G_OBJECT(widgets->priorityCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->prioritySpin);
g_signal_connect(G_OBJECT(widgets->priorityCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),gtk_widget_get_parent(widgets->prioritySpinEntry));
g_signal_connect(G_OBJECT(widgets->runWithUserCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->runWithUserPkexecCheck);
g_signal_connect(G_OBJECT(widgets->runWithUserCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->runWithUserSuCheck);
@ -339,8 +357,12 @@ main_window *setup_window(){
g_signal_connect(G_OBJECT(widgets->priorityCheck),"toggled",G_CALLBACK(on_setup_command),widgets);
g_signal_connect(G_OBJECT(widgets->priorityScale),"value-changed",G_CALLBACK(on_setup_command),widgets);
g_signal_connect(G_OBJECT(widgets->runButton),"clicked",G_CALLBACK(on_command_run),widgets);
g_signal_connect(G_OBJECT(widgets->prioritySpinIncreaseButton),"clicked",G_CALLBACK(on_adjustment_increase),widgets);
g_signal_connect(G_OBJECT(widgets->prioritySpinDecreaseButton),"clicked",G_CALLBACK(on_adjustment_decrease),widgets);
g_signal_connect(G_OBJECT(gtk_range_get_adjustment(GTK_RANGE(widgets->priorityScale))),"value-changed",G_CALLBACK(on_adjustment_changed),widgets);
g_signal_connect(G_OBJECT(widgets->runButton),"clicked",G_CALLBACK(on_command_run),widgets);
int size;
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->runWithUserCombo),"root");
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->runWithUserCombo),0);

@ -1,5 +1,6 @@
#include <gtk/gtk.h>
#include <gtk/gtkx.h>
#include <gtk/gtkspinbutton.h>
#include "ubl-utils.h"
#include <locale.h>
#include <stdio.h>
@ -97,7 +98,9 @@ typedef struct {
GtkWidget *runWithUserCombo;
GtkWidget *priorityCheck;
GtkWidget *priorityScale;
GtkWidget *prioritySpin;
GtkWidget *prioritySpinEntry;
GtkWidget *prioritySpinIncreaseButton;
GtkWidget *prioritySpinDecreaseButton;
GtkWidget *highestPriorityLabel;
GtkWidget *commandCheck;

@ -2,22 +2,27 @@
text-shadow: 2px 2px @theme_bg_color;
color: @theme_text_color;
}
.thin {
margin:0px;
padding:0px;
}
.bannerbackground {
background-color: #404040;
}
.view_app {
background-color: @theme_bg_color;
}
.view_app.view.cell:selected {
background-color:@theme_selected_bg_color;
color:@theme_selected_text_color;
transition: 10ms ease-out;
border-radius: 3px;
}
.boxInfoMessError{
background-color: #ea9999;
}
@ -25,6 +30,7 @@
.boxInfoMessOK{
background-color: #f3f0ac;
}
#GnomeIcon{
border-style:solid;
border-bottom-width: 1px;
@ -39,28 +45,34 @@
#iconlabel {
font-size:14px;
font-weight: bold;
}
.roundborder * {
border-width:0px;
border-radius:5px;
}
.noborder {
border: none;
}
.menu:hover {
border-color:alpha(@theme_text_color, 0.01);
}
.menu {
border-color:alpha(@theme_text_color, 0.01);
}
.menu:hover >* {
border-color:alpha(@theme_text_color, 0.01);
}
.menuitembottom{
margin-top:0px;
margin-bottom:3px;
}
.menuitemmiddle{
margin-top:0px;
margin-bottom:0px;
@ -69,30 +81,36 @@
.menuitemtop{
margin-bottom:0px;
}
.menuitemtop *{
margin:2px 2px 0 2px;
padding: 5px 10px 3px 5px;
}
.menuitemmiddle *{
margin:0 2px 0 2px;
padding: 3px 10px 3px 5px;
}
.menuitembottom *{
margin:0 2px 2px 2px;
padding: 3px 10px 5px 5px;
}
.menuitemtop:hover {
background:@theme_bg_color;
border-color:inherit;
border-left-width:inherit;
border-right-width:inherit;
}
.menuitemmiddle:hover {
background:@theme_bg_color;
border-color:inherit;
border-left-width:inherit;
border-right-width:inherit;
}
.menuitembottom:hover {
background:@theme_bg_color;
border-color:inherit;
@ -100,18 +118,21 @@
border-right-width:inherit;
}
.menuitemtop:hover* {
margin:2px 2px 0 2px;
padding: 5px 10px 3px 5px;
background:@theme_selected_bg_color;
border-radius:2px;
}
.menuitemmiddle:hover* {
margin:0 2px 0 2px;
padding: 3px 10px 3px 5px;
background:@theme_selected_bg_color;
border-radius:2px;
}
.menuitembottom:hover* {
margin:0 2px 2px 2px;
padding: 3px 10px 5px 5px;
@ -122,18 +143,22 @@
.workingbg, #workingbg {
background-color:@theme_base_color;
}
.workingbg.view.cell:selected {
background-color:@theme_selected_bg_color;
}
.workingbg.view.cell:hover {
background-color:darker(@theme_selected_bg_color);
color:@theme_selected_text_color;
border-radius:3px;
}
.bkim {
transition: 200ms ease-out;
background-image: none;
}
.noborder{
border:none;
}
@ -156,18 +181,21 @@ opacity:0.99;
border-left-width:inherit;
border-right-width:inherit;
}
.aaa *{
margin:0 2px 0 2px;
padding-top: 3px;
padding-bottom:3px;
border:transparent;
}
.aaa:hover {
background:@theme_bg_color;
border-color:inherit;
border-left-width:inherit;
border-right-width:inherit;
}
.aaa:hover * {
margin:0 2px 0 2px;
padding-top: 3px;
@ -175,3 +203,21 @@ opacity:0.99;
background:@theme_selected_bg_color;
border-radius:2px;
}
.flatborders {
border-radius: 0px;
}
.flatbordersleft {
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
}
.flatbordersright {
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
}
.noleftborder {
border-left: 0px;
}

@ -67,6 +67,7 @@
</object>
</child>
</object>
<object class="GtkSizeGroup"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">19</property>
<property name="step-increment">1</property>
@ -380,6 +381,16 @@ translated and supported by community.</property>
<property name="can-focus">False</property>
<property name="icon-name">media-playback-start-symbolic</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">value-decrease-symbolic</property>
</object>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">value-increase-symbolic</property>
</object>
<object class="GtkListStore" id="list_Other">
<columns>
<!-- column-name gchararray1 -->
@ -941,18 +952,69 @@ translated and supported by community.</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="prioritySpin">
<object class="GtkBox">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property>
<property name="adjustment">adjustment1</property>
<property name="numeric">True</property>
<child>
<object class="GtkEntry" id="prioritySpinEntry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="valign">center</property>
<property name="width-chars">4</property>
<property name="max-width-chars">2</property>
<property name="text" translatable="yes">0</property>
<property name="input-purpose">digits</property>
<style>
<class name="fatbordersright"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="prioritySpinIncreaseButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">image3</property>
<style>
<class name="flatborders"/>
<class name="noleftborder"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="prioritySpinDecreaseButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">image2</property>
<style>
<class name="flatbordersleft"/>
<class name="noleftborder"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">3</property>
</packing>
</child>
</object>
@ -1156,6 +1218,8 @@ translated and supported by community.</property>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="pixel-size">32</property>
<property name="icon-name">com.ublinux.ublexec</property>
</object>
@ -1192,12 +1256,6 @@ translated and supported by community.</property>
</object>
</child>
</object>
<object class="GtkSizeGroup">
<widgets>
<widget name="prioritySpin"/>
<widget name="lblInfoPriority"/>
</widgets>
</object>
<object class="GtkWindow" id="wndWeb">
<property name="width-request">800</property>
<property name="height-request">600</property>

Loading…
Cancel
Save