Skip to content

Commit

Permalink
Rework custom media size support to remember the last size for each s…
Browse files Browse the repository at this point in the history
…ource.
  • Loading branch information
michaelrsweet committed Dec 7, 2023
1 parent 7a96972 commit 77b1080
Show file tree
Hide file tree
Showing 8 changed files with 159 additions and 239 deletions.
325 changes: 156 additions & 169 deletions lprint-common.c

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions lprint.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,11 @@ typedef struct lprint_dither_s // Dithering state
unsigned out_width; // Output width in bytes
} lprint_dither_t;

typedef struct lprint_media_s // Custom label sizes (per-printer)
typedef struct lprint_cmedia_s // Custom label sizes (per-printer/source)
{
# ifndef _WIN32
pthread_rwlock_t rwlock; // Reader/writer lock
# endif // !_WIN32
int num_media; // Number of custom media size names
char media[LPRINT_MAX_CUSTOM][128];
char custom_name[PAPPL_MAX_SOURCE][128];
// Custom media size names
} lprint_media_t;
} lprint_cmedia_t;


//
Expand Down
1 change: 0 additions & 1 deletion static-resources/lprint-de.strings
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,3 @@
"media.om_vhs-face_45x72mm" = "45 x 72mm VHS Face Label";
"media.om_vhs-spine_18x141mm" = "18 x 141mm VHS Spine Label";
"media.om_zip-disk_48x55mm" = "48 x 55mm Zip Disk Label";
"Delete %s?" = "Delete %s";
1 change: 0 additions & 1 deletion static-resources/lprint-en.strings
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,3 @@
"media.om_vhs-face_45x72mm" = "45 x 72mm VHS Face Label";
"media.om_vhs-spine_18x141mm" = "18 x 141mm VHS Spine Label";
"media.om_zip-disk_48x55mm" = "48 x 55mm Zip Disk Label";
"Delete %s?" = "Delete %s";
1 change: 0 additions & 1 deletion static-resources/lprint-es.strings
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,3 @@
"media.om_vhs-face_45x72mm" = "45 x 72mm VHS Face Label";
"media.om_vhs-spine_18x141mm" = "18 x 141mm VHS Spine Label";
"media.om_zip-disk_48x55mm" = "48 x 55mm Zip Disk Label";
"Delete %s?" = "Delete %s";
1 change: 0 additions & 1 deletion static-resources/lprint-fr.strings
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,3 @@
"media.om_vhs-face_45x72mm" = "45 x 72mm VHS Face Label";
"media.om_vhs-spine_18x141mm" = "18 x 141mm VHS Spine Label";
"media.om_zip-disk_48x55mm" = "48 x 55mm Zip Disk Label";
"Delete %s?" = "Delete %s";
1 change: 0 additions & 1 deletion static-resources/lprint-it.strings
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,3 @@
"media.om_vhs-face_45x72mm" = "45 x 72mm VHS Face Label";
"media.om_vhs-spine_18x141mm" = "18 x 141mm VHS Spine Label";
"media.om_zip-disk_48x55mm" = "48 x 55mm Zip Disk Label";
"Delete %s?" = "Delete %s";
58 changes: 0 additions & 58 deletions static-resources/lprint.css
Original file line number Diff line number Diff line change
Expand Up @@ -203,44 +203,6 @@ label.switch input {
height: 0;
}

.radio-list input[type="radio"] {
display: none;
}
.radio-list label.radio-label {
background-color: #eee;
border: 1px solid rgba(0,0,0,0.2);
border-bottom: none;
cursor: pointer;
display: inline-block;
padding: 2px 10px;
width: 14em;
transition: all 0.2s ease-in-out;
}
.radio-list input[type="radio"]:checked + label.radio-label {
background-color: #777;
color: white;
}
.radio-list:first-child label.radio-label {
border-radius: 5px 5px 0 0;
}
.radio-list:nth-last-child(2) label.radio-label {
border-bottom: 1px solid rgba(0,0,0,0.2);
border-radius: 0 0 5px 5px;
}
button.radio-action {
background: none;
border: none;
color: black;
float: right;
}
.radio-list input[type="radio"]:checked + label.radio-label button.radio-action {
color: white;
}
button.radio-action:hover, button.radio-action:active {
background: #777;
color: #eee;
}

img.password-show, img.password-hide {
cursor: pointer;
margin-left: -25px;
Expand Down Expand Up @@ -597,26 +559,6 @@ table.meter th {
color: #333;
}

.radio-list label.radio-label {
background-color: #333;
border: 1px solid rgba(191,191,191,0.2);
}
.radio-list input[type="radio"]:checked + label.radio-label {
background-color: rgba(112,112,112,0.5);
color: #ccc;
}
.radio-list:nth-last-child(2) label.radio-label {
border-bottom: 1px solid rgba(191,191,191,0.2);
}
.radio-list input[type="radio"]:checked + label.radio-label button.radio-action, button.radio-action {
color: #ccc;
}
button.radio-action:hover, button.radio-action:active {
background: rgba(112,112,112, 0.75);
border: none;
color: #eee;
}

table.list {
border-bottom: solid thin #ccc;
}
Expand Down

0 comments on commit 77b1080

Please sign in to comment.